tachikoma_ai 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -0
- data/lib/tachikoma_ai/repository.rb +17 -9
- data/lib/tachikoma_ai/strategies/bundler/gem.rb +4 -3
- data/lib/tachikoma_ai/strategies/bundler/github_urls.json +18 -0
- data/lib/tachikoma_ai/version.rb +1 -1
- metadata +3 -3
- data/lib/tachikoma_ai/strategies/bundler/urls.json +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 490b72c7037724b06a533189f7535644cfd2c4c4
|
4
|
+
data.tar.gz: da5885c1d9ed78a314fbfb399a8566a398ea4881
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dfcdbf60791a9c7fa84c0c2e8e376a5612744aa395e16efd5e921f0f80d405af352f0646c4ba55a351bb7238388807df97cc963fe225b6b7824242dbd83dd30
|
7
|
+
data.tar.gz: 6d41b37db99dc05343d069c89c05c2e0e378b3b6542432396971d9ce248e9ce9eaa9ae4c6f00d71d13778b28dcdf5534a423498cda64fa76e34868b51c4d6a0a
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -13,7 +13,14 @@ module TachikomaAi
|
|
13
13
|
def compare(start, endd)
|
14
14
|
s = find_tag(start)
|
15
15
|
e = find_tag(endd)
|
16
|
-
"https://github.com/#{owner}/#{repo}
|
16
|
+
base = "https://github.com/#{owner}/#{repo}"
|
17
|
+
if s.nil? && e.nil?
|
18
|
+
"#{base} (tags not found)"
|
19
|
+
elsif e.nil?
|
20
|
+
"#{base}/compare/#{s}...master"
|
21
|
+
else
|
22
|
+
"#{base}/compare/#{s}...#{e}"
|
23
|
+
end
|
17
24
|
end
|
18
25
|
|
19
26
|
private
|
@@ -30,21 +37,22 @@ module TachikomaAi
|
|
30
37
|
return @tags if @tags
|
31
38
|
|
32
39
|
res = fetch(api_tags_url)
|
33
|
-
|
34
|
-
|
40
|
+
@tags = if res.is_a? Net::HTTPSuccess
|
41
|
+
json = JSON.parse(res.body)
|
42
|
+
json.map { |tag| tag['ref'].gsub('refs/tags/', '') }
|
43
|
+
else
|
44
|
+
{}
|
45
|
+
end
|
35
46
|
end
|
36
47
|
|
37
48
|
def fetch(uri_str, limit = 10)
|
38
|
-
raise ArgumentError, 'HTTP redirect too deep' if limit
|
49
|
+
raise ArgumentError, 'HTTP redirect too deep' if limit.zero?
|
39
50
|
|
40
51
|
response = Net::HTTP.get_response URI.parse(uri_str)
|
41
|
-
|
42
|
-
when Net::HTTPSuccess
|
43
|
-
response
|
44
|
-
when Net::HTTPRedirection
|
52
|
+
if response.is_a? Net::HTTPRedirection
|
45
53
|
fetch(response['location'], limit - 1)
|
46
54
|
else
|
47
|
-
response
|
55
|
+
response
|
48
56
|
end
|
49
57
|
end
|
50
58
|
end
|
@@ -7,7 +7,8 @@ module TachikomaAi
|
|
7
7
|
class Gem
|
8
8
|
major, minor = RUBY_VERSION.split('.')
|
9
9
|
SPECS_PATH = "vendor/bundle/ruby/#{major}.#{minor}.0/specifications/".freeze
|
10
|
-
|
10
|
+
GITHUB_URLS = File.read(File.expand_path('github_urls.json', __dir__))
|
11
|
+
GITHUB_URL_JSON = JSON.parse(GITHUB_URLS)
|
11
12
|
|
12
13
|
attr_reader :name, :from, :version
|
13
14
|
|
@@ -24,8 +25,8 @@ module TachikomaAi
|
|
24
25
|
def github_url
|
25
26
|
if homepage.include?('github.com')
|
26
27
|
homepage
|
27
|
-
elsif
|
28
|
-
|
28
|
+
elsif GITHUB_URL_JSON.key?(name)
|
29
|
+
"https://github.com/#{GITHUB_URL_JSON[name]}"
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"action_args": "asakusarb/action_args",
|
3
|
+
"airbrake": "airbrake/airbrake",
|
4
|
+
"capistrano": "capistrano/capistrano",
|
5
|
+
"coderay": "rubychan/coderay",
|
6
|
+
"concurrent-ruby": "ruby-concurrency/concurrent-ruby",
|
7
|
+
"eventmachine": "eventmachine/eventmachine",
|
8
|
+
"logging": "TwP/logging",
|
9
|
+
"nokogiri": "sparklemotion/nokogiri",
|
10
|
+
"puma": "puma/puma",
|
11
|
+
"rails_best_practices": "railsbp/rails_best_practices",
|
12
|
+
"rack-mini-profiler": "MiniProfiler/rack-mini-profiler",
|
13
|
+
"sass": "sass/sass",
|
14
|
+
"sidekiq": "mperham/sidekiq",
|
15
|
+
"thin": "macournoyer/thin",
|
16
|
+
"unicorn": "defunkt/unicorn",
|
17
|
+
"uniform_notifier": "flyerhzm/uniform_notifier"
|
18
|
+
}
|
data/lib/tachikoma_ai/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tachikoma_ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sinsoku
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tachikoma
|
@@ -103,7 +103,7 @@ files:
|
|
103
103
|
- lib/tachikoma_ai/repository.rb
|
104
104
|
- lib/tachikoma_ai/strategies/bundler.rb
|
105
105
|
- lib/tachikoma_ai/strategies/bundler/gem.rb
|
106
|
-
- lib/tachikoma_ai/strategies/bundler/
|
106
|
+
- lib/tachikoma_ai/strategies/bundler/github_urls.json
|
107
107
|
- lib/tachikoma_ai/strategy.rb
|
108
108
|
- lib/tachikoma_ai/tachikoma_extention.rb
|
109
109
|
- lib/tachikoma_ai/version.rb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"action_args": "https://github.com/asakusarb/action_args",
|
3
|
-
"airbrake": "https://github.com/airbrake/airbrake",
|
4
|
-
"capistrano": "https://github.com/capistrano/capistrano",
|
5
|
-
"coderay": "https://github.com/rubychan/coderay",
|
6
|
-
"concurrent-ruby": "https://github.com/ruby-concurrency/concurrent-ruby",
|
7
|
-
"eventmachine": "https://github.com/eventmachine/eventmachine",
|
8
|
-
"logging": "https://github.com/TwP/logging",
|
9
|
-
"nokogiri": "https://github.com/sparklemotion/nokogiri",
|
10
|
-
"rails_best_practices": "https://github.com/railsbp/rails_best_practices",
|
11
|
-
"rack-mini-profiler": "https://github.com/MiniProfiler/rack-mini-profiler",
|
12
|
-
"sass": "https://github.com/sass/sass",
|
13
|
-
"sidekiq": "https://github.com/mperham/sidekiq",
|
14
|
-
"thin": "https://github.com/macournoyer/thin",
|
15
|
-
"unicorn": "https://github.com/defunkt/unicorn",
|
16
|
-
"uniform_notifier": "https://github.com/flyerhzm/uniform_notifier"
|
17
|
-
}
|