mirror of
https://github.com/dkhamsing/open-source-ios-apps.git
synced 2025-01-31 02:37:05 +01:00
commit
b6152841a2
24
.github/osia_get_history.rb
vendored
Normal file
24
.github/osia_get_history.rb
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
require_relative 'osia_helper'
|
||||||
|
|
||||||
|
HISTORY = 'git_history'
|
||||||
|
|
||||||
|
j = get_json
|
||||||
|
apps = j['projects']
|
||||||
|
|
||||||
|
h = {}
|
||||||
|
apps.each_with_index do |a, i|
|
||||||
|
t = a['title']
|
||||||
|
puts "#{i + 1}/#{apps.count}. checking #{t}"
|
||||||
|
command = "git log --all --grep='#{t}'"
|
||||||
|
|
||||||
|
begin
|
||||||
|
r = `#{command}`
|
||||||
|
rescue e
|
||||||
|
r = e
|
||||||
|
end
|
||||||
|
|
||||||
|
h[t] = r
|
||||||
|
end
|
||||||
|
|
||||||
|
File.open(HISTORY, 'w') { |f| f.write JSON.pretty_generate h }
|
||||||
|
puts "wrote #{HISTORY} ✨"
|
12
.github/osia_history_missing.rb
vendored
Normal file
12
.github/osia_history_missing.rb
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
require_relative 'osia_helper'
|
||||||
|
|
||||||
|
j = get_json
|
||||||
|
apps = j['projects']
|
||||||
|
|
||||||
|
i = 0
|
||||||
|
apps.each do |a|
|
||||||
|
if a['date_added'].nil?
|
||||||
|
puts "#{i + 1}. History missing for #{a['title']}"
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
end
|
74
.github/osia_update_history.rb
vendored
Normal file
74
.github/osia_update_history.rb
vendored
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
require_relative 'osia_helper'
|
||||||
|
|
||||||
|
require 'awesome_print'
|
||||||
|
require 'colored'
|
||||||
|
|
||||||
|
HISTORY = 'git_history'
|
||||||
|
|
||||||
|
def get_author(a)
|
||||||
|
a = a.gsub 'Author:', ''
|
||||||
|
|
||||||
|
u =
|
||||||
|
if a.include? 'users.noreply.github.com>'
|
||||||
|
m = /<.*?@/.match a
|
||||||
|
'@' + m[0].sub('@','')
|
||||||
|
else
|
||||||
|
m = /.*</.match a
|
||||||
|
m[0]
|
||||||
|
end
|
||||||
|
|
||||||
|
t = u.sub('<', '').strip
|
||||||
|
|
||||||
|
t
|
||||||
|
end
|
||||||
|
|
||||||
|
j = get_json
|
||||||
|
apps = j['projects']
|
||||||
|
updated = []
|
||||||
|
|
||||||
|
c = File.read HISTORY
|
||||||
|
history = JSON.parse c
|
||||||
|
|
||||||
|
apps.each_with_index do |a, i|
|
||||||
|
t = a['title']
|
||||||
|
|
||||||
|
puts "#{i + 1}/#{apps.count}. Updating #{t}".yellow
|
||||||
|
|
||||||
|
h = history[t]
|
||||||
|
|
||||||
|
# TODO: skip entries with history
|
||||||
|
|
||||||
|
if h.size==0
|
||||||
|
updated.push a
|
||||||
|
else
|
||||||
|
lines = h.split "\n"
|
||||||
|
|
||||||
|
d=''
|
||||||
|
u=''
|
||||||
|
lines.reverse.each do |x|
|
||||||
|
# puts x
|
||||||
|
if d=='' || u==''
|
||||||
|
if x.include? 'Date:'
|
||||||
|
d = x.gsub('Date:','').strip
|
||||||
|
# d = x.gsub 'Date:',''
|
||||||
|
# puts d
|
||||||
|
end
|
||||||
|
|
||||||
|
if x.include? 'Author:'
|
||||||
|
u = get_author(x)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
a['date_added'] = d
|
||||||
|
a['suggested_by'] = u
|
||||||
|
updated.push a
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
j['projects'] = updated
|
||||||
|
|
||||||
|
File.open(FILE, 'w') { |f| f.write JSON.pretty_generate(j) }
|
||||||
|
puts "\nUpdated #{FILE} ⭐️"
|
11
.github/schema.json
vendored
11
.github/schema.json
vendored
@ -137,8 +137,17 @@
|
|||||||
"description": "A place to put any metadata for a project. The items can be any type.",
|
"description": "A place to put any metadata for a project. The items can be any type.",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"default": []
|
"default": []
|
||||||
|
},
|
||||||
|
"suggested_by": {
|
||||||
|
"title": "Suggested By",
|
||||||
|
"description": "Name of person who suggested project.",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"date_added": {
|
||||||
|
"title": "Date Added",
|
||||||
|
"description": "Date when project was added.",
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
"required": ["title", "category", "source"],
|
"required": ["title", "category", "source"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
2526
contents.json
2526
contents.json
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user