tangled
alpha
login
or
join now
mackuba.eu
/
sdk.blue
6
fork
atom
A curated list of libraries & SDKs for the Bluesky API and AT Protocol
6
fork
atom
overview
issues
2
pulls
pipelines
added an option to refresh metadata only for one section
mackuba.eu
1 year ago
0ac80bf4
d4ee941a
+13
-7
2 changed files
expand all
collapse all
unified
split
Rakefile
lib
metadata_import.rb
+1
-1
Rakefile
···
2
2
3
3
task :fetch_metadata do
4
4
import = MetadataImport.new
5
5
-
import.run
5
5
+
import.run(language: ENV['LANGUAGE'])
6
6
end
+12
-6
lib/metadata_import.rb
···
4
4
OUTPUT_FILE = '_data/github_info.yml'
5
5
PROJECTS_DIR = '_data/projects'
6
6
7
7
-
def run
8
8
-
urls = get_repo_urls
7
7
+
def run(language: nil)
8
8
+
output_path = File.join(__dir__, '..', OUTPUT_FILE)
9
9
+
10
10
+
if language
11
11
+
data = YAML.load_file(output_path, permitted_classes: [Time])
12
12
+
else
13
13
+
data = {}
14
14
+
end
15
15
+
16
16
+
urls = get_repo_urls(language)
9
17
importers = [GithubImport.new]
10
10
-
data = {}
11
18
12
19
urls.each do |url|
13
20
if imp = importers.detect { |i| i.url_matches?(url) }
···
18
25
end
19
26
end
20
27
21
21
-
output_path = File.join(__dir__, '..', OUTPUT_FILE)
22
28
File.write(output_path, YAML.dump(data))
23
29
end
24
30
25
25
-
def get_repo_urls
26
26
-
yamls = Dir[File.join(__dir__, '..', '_data', 'projects', '*.yml')]
31
31
+
def get_repo_urls(language = nil)
32
32
+
yamls = Dir[File.join(__dir__, '..', '_data', 'projects', language ? "#{language}.yml" : '*.yml')]
27
33
yamls.map { |x| YAML.load(File.read(x))['repos'] }.flatten.map { |x| x['url'] }
28
34
end
29
35
end