gemdiff 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80e10c9bdcb66f4c19cd26e3c9f9ccb1810f7006
4
- data.tar.gz: 06bbdbfb7da6cab122545d91ebc94ae4c56418ce
3
+ metadata.gz: 7a8b2e2806527ac1763da036a86c5aa926ddabb4
4
+ data.tar.gz: dafa22c4369e76851676701b477a67edea4a2967
5
5
  SHA512:
6
- metadata.gz: 9c2abd3e49411e4439e78e2410f6dc20b7bdd995094987320a1c9eabab524f35cbe8da125f4294cfc380073412d4f1a6f6c8ea595d86f317c154d5ece38dddb8
7
- data.tar.gz: 6f2edf76411e2892ec007440092b5a873c48d1771bc9836ec23ccea178a95d98c34c93a26777bdd7bc5575ff884870ed562dfd4d14186da73bcdbef38aaeaced
6
+ metadata.gz: 26e1675325dc0b7bc645134defc976cc1c7624279c7c7c52e7efdb41f2a675227af3954fc7b037ee7a1ea9d0d3da103e45bbf8f207fbfbde4411b0030d4248a2
7
+ data.tar.gz: 8d983e49afd8ffdd92affb06f8f9e848dac87a9549d0c1dda4db83d1d289865ff02f833206d45a15ca7dfb0402782393843b414835e0fd426efad2effad3428d
@@ -1,5 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.3
3
+ - 2.1.4
4
4
  - 2.0.0
5
5
  - 1.9.3
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  platform :mri_21 do
4
4
  unless ENV['TRAVIS']
5
- gem "pry-byebug", "~> 1.3"
5
+ gem "pry-byebug", "~> 2.0"
6
6
  end
7
7
  end
8
8
 
@@ -13,31 +13,28 @@ module Gemdiff
13
13
 
14
14
  desc 'find <gem>', 'Find the github repository URL for a gem'
15
15
  def find(gem_name)
16
- gem = OutdatedGem.new(gem_name)
17
- if gem.repo?
18
- puts gem.repo
16
+ outdated_gem = OutdatedGem.new(gem_name)
17
+ if outdated_gem.repo?
18
+ puts outdated_gem.repo
19
19
  else
20
20
  puts "Could not find github repository for #{gem_name}."
21
21
  end
22
- gem
22
+ outdated_gem
23
23
  end
24
24
 
25
25
  desc 'open <gem>', 'Open the github repository for a gem'
26
26
  def open(gem_name)
27
- gem = find(gem_name)
28
- gem.open
27
+ find(gem_name).open
29
28
  end
30
29
 
31
30
  desc 'releases <gem>', 'Open the github releases page for a gem'
32
31
  def releases(gem_name)
33
- gem = find(gem_name)
34
- gem.releases
32
+ find(gem_name).releases
35
33
  end
36
34
 
37
35
  desc 'master <gem>', 'Open the github master branch commits page for a gem'
38
36
  def master(gem_name)
39
- gem = find(gem_name)
40
- gem.master
37
+ find(gem_name).master
41
38
  end
42
39
 
43
40
  desc 'compare <gem> [<old> <new>]', <<DESC
@@ -46,18 +43,18 @@ If versions are not specified, your bundle is inspected and the latest version o
46
43
  gem is compared with the current version in your bundle.
47
44
  DESC
48
45
  def compare(gem_name, old_version = nil, new_version = nil)
49
- gem = find(gem_name)
50
- return unless gem.repo?
51
- gem.set_versions old_version, new_version
52
- if gem.missing_versions?
46
+ outdated_gem = find(gem_name)
47
+ return unless outdated_gem.repo?
48
+ outdated_gem.set_versions old_version, new_version
49
+ if outdated_gem.missing_versions?
53
50
  puts CHECKING_FOR_OUTDATED
54
- unless gem.load_bundle_versions
51
+ unless outdated_gem.load_bundle_versions
55
52
  puts "#{gem_name} is not outdated in your bundle. Specify versions."
56
53
  return
57
54
  end
58
55
  end
59
- puts gem.compare_message
60
- gem.compare
56
+ puts outdated_gem.compare_message
57
+ outdated_gem.compare
61
58
  end
62
59
 
63
60
  desc 'outdated', 'Compare each outdated gem in the bundle. You will be prompted to open each compare view.'
@@ -65,23 +62,21 @@ DESC
65
62
  puts CHECKING_FOR_OUTDATED
66
63
  inspector = BundleInspector.new
67
64
  puts inspector.outdated
68
- inspector.list.each do |gem|
69
- puts gem.compare_message
65
+ inspector.list.each do |outdated_gem|
66
+ puts outdated_gem.compare_message
70
67
  response = ask("Open? (y to open, x to exit, else skip)")
71
- gem.compare if response == 'y'
68
+ outdated_gem.compare if response == 'y'
72
69
  return if response == 'x'
73
70
  end
74
71
  end
75
72
 
76
73
  desc 'update <gem>', 'Update a gem, show a git diff of the update, and commit or reset'
77
74
  def update(name)
78
- gem = GemUpdater.new(name)
79
- unless gem.clean?
80
- puts WORKING_DIRECTORY_IS_NOT_CLEAN
81
- end
75
+ gem_updater = GemUpdater.new(name)
76
+ puts WORKING_DIRECTORY_IS_NOT_CLEAN unless gem_updater.clean?
82
77
  puts "Updating #{name}..."
83
- gem.update
84
- diff_output = colorize_git_output(gem.diff)
78
+ gem_updater.update
79
+ diff_output = colorize_git_output(gem_updater.diff)
85
80
  puts diff_output
86
81
  if diff_output.empty?
87
82
  puts NOTHING_TO_UPDATE
@@ -89,10 +84,10 @@ DESC
89
84
  end
90
85
  response = ask("\nCommit? (c to commit, r to reset, else do nothing)")
91
86
  if response == 'c'
92
- gem.commit
93
- puts "\n" + colorize_git_output(gem.show)
87
+ gem_updater.commit
88
+ puts "\n" + colorize_git_output(gem_updater.show)
94
89
  elsif response == 'r'
95
- puts gem.reset
90
+ puts gem_updater.reset
96
91
  end
97
92
  end
98
93
  end
@@ -13,6 +13,7 @@ module Gemdiff
13
13
  compass
14
14
  ffi
15
15
  haml
16
+ mail
16
17
  rvm-capistrano
17
18
  safe_yaml
18
19
  sass
@@ -35,10 +36,10 @@ module Gemdiff
35
36
  end
36
37
 
37
38
  def load_bundle_versions
38
- gem = BundleInspector.new.get(@name)
39
- return false if gem.nil?
40
- @old_version ||= gem.old_version
41
- @new_version ||= gem.new_version
39
+ outdated_gem = BundleInspector.new.get(@name)
40
+ return false if outdated_gem.nil?
41
+ @old_version ||= outdated_gem.old_version
42
+ @new_version ||= outdated_gem.new_version
42
43
  true
43
44
  end
44
45
 
@@ -17,6 +17,7 @@ module Gemdiff
17
17
  activemodel: 'rails/rails',
18
18
  activerecord: 'rails/rails',
19
19
  activesupport: 'rails/rails',
20
+ chunky_png: 'wvanbergen/chunky_png',
20
21
  :"color-schemer" => 'Team-Sass/color-schemer',
21
22
  delayed_job: 'collectiveidea/delayed_job',
22
23
  ffi: 'ffi/ffi',
@@ -49,7 +50,7 @@ module Gemdiff
49
50
  end
50
51
  return nil unless (yaml = gemspec(gem_name))
51
52
  spec = YAML.load(yaml)
52
- return spec.homepage if spec.homepage =~ GITHUB_REPO_REGEX
53
+ return spec.homepage if spec.homepage =~ GITHUB_REPO_REGEX
53
54
  match = spec.description.match(GITHUB_REPO_REGEX)
54
55
  match && match[0]
55
56
  end
@@ -1,3 +1,3 @@
1
1
  module Gemdiff
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
@@ -22,53 +22,53 @@ module Gemdiff
22
22
 
23
23
  describe "#open" do
24
24
  it "opens repo" do
25
- gem = mock_gem("haml")
25
+ outdated_gem = mock_gem("haml")
26
26
  @cli.expects(:puts).with("http://github.com/haml/haml")
27
- gem.expects :open
27
+ outdated_gem.expects :open
28
28
  @cli.open "haml"
29
29
  end
30
30
  end
31
31
 
32
32
  describe "#releases" do
33
33
  it "opens releases page" do
34
- gem = mock_gem("haml")
34
+ outdated_gem = mock_gem("haml")
35
35
  @cli.expects(:puts).with("http://github.com/haml/haml")
36
- gem.expects :releases
36
+ outdated_gem.expects :releases
37
37
  @cli.releases "haml"
38
38
  end
39
39
  end
40
40
 
41
41
  describe "#master" do
42
42
  it "opens commits page" do
43
- gem = mock_gem("haml")
43
+ outdated_gem = mock_gem("haml")
44
44
  @cli.expects(:puts).with("http://github.com/haml/haml")
45
- gem.expects :master
45
+ outdated_gem.expects :master
46
46
  @cli.master "haml"
47
47
  end
48
48
  end
49
49
 
50
50
  describe "#compare" do
51
51
  it "opens compare view using bundle" do
52
- gem = mock_gem("haml")
52
+ outdated_gem = mock_gem("haml")
53
53
  @cli.expects(:puts).with("http://github.com/haml/haml")
54
- gem.expects(:set_versions).with(nil, nil)
55
- gem.expects(:missing_versions?).returns(true)
54
+ outdated_gem.expects(:set_versions).with(nil, nil)
55
+ outdated_gem.expects(:missing_versions?).returns(true)
56
56
  @cli.expects(:puts).with(CLI::CHECKING_FOR_OUTDATED)
57
- gem.expects(:load_bundle_versions).returns(true)
58
- gem.expects(:compare_message).returns("compare message")
57
+ outdated_gem.expects(:load_bundle_versions).returns(true)
58
+ outdated_gem.expects(:compare_message).returns("compare message")
59
59
  @cli.expects(:puts).with("compare message")
60
- gem.expects :compare
60
+ outdated_gem.expects :compare
61
61
  @cli.compare "haml"
62
62
  end
63
63
 
64
64
  it "opens compare view with versions" do
65
- gem = mock_gem("haml")
65
+ outdated_gem = mock_gem("haml")
66
66
  @cli.expects(:puts).with("http://github.com/haml/haml")
67
- gem.expects(:set_versions).with("4.0.4", "4.0.5")
68
- gem.expects(:missing_versions?).returns(false)
69
- gem.expects(:compare_message).returns("compare message")
67
+ outdated_gem.expects(:set_versions).with("4.0.4", "4.0.5")
68
+ outdated_gem.expects(:missing_versions?).returns(false)
69
+ outdated_gem.expects(:compare_message).returns("compare message")
70
70
  @cli.expects(:puts).with("compare message")
71
- gem.expects :compare
71
+ outdated_gem.expects :compare
72
72
  @cli.compare "haml", "4.0.4", "4.0.5"
73
73
  end
74
74
 
@@ -92,9 +92,9 @@ module Gemdiff
92
92
  end
93
93
 
94
94
  it "compares outdated gems with responses of y" do
95
- gem = OutdatedGem.new("haml", "4.0.4", "4.0.5")
95
+ outdated_gem = OutdatedGem.new("haml", "4.0.4", "4.0.5")
96
96
  mock_inspector = mock do
97
- stubs list: [gem]
97
+ stubs list: [outdated_gem]
98
98
  stubs outdated: "outdated"
99
99
  end
100
100
  BundleInspector.stubs new: mock_inspector
@@ -102,14 +102,14 @@ module Gemdiff
102
102
  @cli.expects(:puts).with(CLI::CHECKING_FOR_OUTDATED)
103
103
  @cli.expects(:puts).with("outdated")
104
104
  @cli.expects(:puts).with("haml: 4.0.5 > 4.0.4")
105
- gem.expects :compare
105
+ outdated_gem.expects :compare
106
106
  @cli.outdated
107
107
  end
108
108
 
109
109
  it "skips outdated gems without responses of y" do
110
- gem = OutdatedGem.new("haml", "4.0.4", "4.0.5")
110
+ outdated_gem = OutdatedGem.new("haml", "4.0.4", "4.0.5")
111
111
  mock_inspector = mock do
112
- stubs list: [gem]
112
+ stubs list: [outdated_gem]
113
113
  stubs outdated: "outdated"
114
114
  end
115
115
  BundleInspector.stubs new: mock_inspector
@@ -117,7 +117,7 @@ module Gemdiff
117
117
  @cli.expects(:puts).with(CLI::CHECKING_FOR_OUTDATED)
118
118
  @cli.expects(:puts).with("outdated")
119
119
  @cli.expects(:puts).with("haml: 4.0.5 > 4.0.4")
120
- gem.expects(:compare).never
120
+ outdated_gem.expects(:compare).never
121
121
  @cli.outdated
122
122
  end
123
123
  end
@@ -164,18 +164,18 @@ module Gemdiff
164
164
  private
165
165
 
166
166
  def mock_gem(name)
167
- gem = mock do
167
+ outdated_gem = mock do
168
168
  stubs repo?: true
169
169
  stubs repo: "http://github.com/#{name}/#{name}"
170
170
  end
171
- OutdatedGem.stubs new: gem
172
- gem
171
+ OutdatedGem.stubs new: outdated_gem
172
+ outdated_gem
173
173
  end
174
174
 
175
175
  def mock_missing_gem
176
- gem = mock { stubs repo?: false }
177
- OutdatedGem.stubs new: gem
178
- gem
176
+ outdated_gem = mock { stubs repo?: false }
177
+ OutdatedGem.stubs new: outdated_gem
178
+ outdated_gem
179
179
  end
180
180
  end
181
181
  end
@@ -14,45 +14,45 @@ module Gemdiff
14
14
 
15
15
  describe "#compare_url" do
16
16
  it "returns compare url" do
17
- gem = OutdatedGem.new("x", "1.0", "2.0")
18
- gem.stubs repo: "http://github.com/x/x"
19
- assert_equal "http://github.com/x/x/compare/v1.0...v2.0", gem.compare_url
17
+ outdated_gem = OutdatedGem.new("x", "1.0", "2.0")
18
+ outdated_gem.stubs repo: "http://github.com/x/x"
19
+ assert_equal "http://github.com/x/x/compare/v1.0...v2.0", outdated_gem.compare_url
20
20
  end
21
21
 
22
22
  it "returns compare url with no v for exceptions" do
23
- gem = OutdatedGem.new("haml", "4.0.0", "4.1.0")
24
- gem.stubs repo: "http://github.com/haml/haml"
25
- assert_equal "http://github.com/haml/haml/compare/4.0.0...4.1.0", gem.compare_url
23
+ outdated_gem = OutdatedGem.new("haml", "4.0.0", "4.1.0")
24
+ outdated_gem.stubs repo: "http://github.com/haml/haml"
25
+ assert_equal "http://github.com/haml/haml/compare/4.0.0...4.1.0", outdated_gem.compare_url
26
26
  end
27
27
 
28
28
  it "returns compare url with branch name for new version" do
29
- gem = OutdatedGem.new("x", "4.0.0", "master")
30
- gem.stubs repo: "http://github.com/x/x"
31
- assert_equal "http://github.com/x/x/compare/v4.0.0...master", gem.compare_url
29
+ outdated_gem = OutdatedGem.new("x", "4.0.0", "master")
30
+ outdated_gem.stubs repo: "http://github.com/x/x"
31
+ assert_equal "http://github.com/x/x/compare/v4.0.0...master", outdated_gem.compare_url
32
32
  end
33
33
  end
34
34
 
35
35
  describe "#releases_url" do
36
36
  it "returns releases url" do
37
- gem = OutdatedGem.new("x")
38
- gem.stubs repo: "http://github.com/x/x"
39
- assert_equal "http://github.com/x/x/releases", gem.releases_url
37
+ outdated_gem = OutdatedGem.new("x")
38
+ outdated_gem.stubs repo: "http://github.com/x/x"
39
+ assert_equal "http://github.com/x/x/releases", outdated_gem.releases_url
40
40
  end
41
41
  end
42
42
 
43
43
  describe "#commits_url" do
44
44
  it "returns commits url" do
45
- gem = OutdatedGem.new("x")
46
- gem.stubs repo: "http://github.com/x/x"
47
- assert_equal "http://github.com/x/x/commits/master", gem.commits_url
45
+ outdated_gem = OutdatedGem.new("x")
46
+ outdated_gem.stubs repo: "http://github.com/x/x"
47
+ assert_equal "http://github.com/x/x/commits/master", outdated_gem.commits_url
48
48
  end
49
49
  end
50
50
 
51
51
  describe "#compare_message" do
52
52
  it "returns compare message" do
53
- gem = OutdatedGem.new("x", "1", "2")
54
- gem.stubs repo: "http://github.com/x/x"
55
- assert_equal "x: 2 > 1", gem.compare_message
53
+ outdated_gem = OutdatedGem.new("x", "1", "2")
54
+ outdated_gem.stubs repo: "http://github.com/x/x"
55
+ assert_equal "x: 2 > 1", outdated_gem.compare_message
56
56
  end
57
57
  end
58
58
 
@@ -67,83 +67,83 @@ module Gemdiff
67
67
  mock_outdated_gem = OutdatedGem.new("y", "1.2.3", "2.3.4")
68
68
  mock_inspector = mock { stubs get: mock_outdated_gem }
69
69
  BundleInspector.stubs new: mock_inspector
70
- gem = OutdatedGem.new("y")
71
- assert gem.load_bundle_versions
72
- assert_equal "1.2.3", gem.old_version
73
- assert_equal "2.3.4", gem.new_version
70
+ outdated_gem = OutdatedGem.new("y")
71
+ assert outdated_gem.load_bundle_versions
72
+ assert_equal "1.2.3", outdated_gem.old_version
73
+ assert_equal "2.3.4", outdated_gem.new_version
74
74
  end
75
75
  end
76
76
 
77
77
  describe "#set_versions" do
78
78
  it "sets nil versions" do
79
- gem = OutdatedGem.new("x", "1", "2")
80
- gem.set_versions nil, nil
81
- assert_nil gem.old_version
82
- assert_nil gem.new_version
79
+ outdated_gem = OutdatedGem.new("x", "1", "2")
80
+ outdated_gem.set_versions nil, nil
81
+ assert_nil outdated_gem.old_version
82
+ assert_nil outdated_gem.new_version
83
83
  end
84
84
 
85
85
  it "sets old, new versions" do
86
- gem = OutdatedGem.new("x")
87
- gem.set_versions "1.2.34", "2.34.56"
88
- assert_equal "1.2.34", gem.old_version
89
- assert_equal "2.34.56", gem.new_version
86
+ outdated_gem = OutdatedGem.new("x")
87
+ outdated_gem.set_versions "1.2.34", "2.34.56"
88
+ assert_equal "1.2.34", outdated_gem.old_version
89
+ assert_equal "2.34.56", outdated_gem.new_version
90
90
  end
91
91
 
92
92
  it "swaps versions in the wrong order" do
93
- gem = OutdatedGem.new("x")
94
- gem.set_versions "2.34.56", "1.2.34"
95
- assert_equal "1.2.34", gem.old_version
96
- assert_equal "2.34.56", gem.new_version
93
+ outdated_gem = OutdatedGem.new("x")
94
+ outdated_gem.set_versions "2.34.56", "1.2.34"
95
+ assert_equal "1.2.34", outdated_gem.old_version
96
+ assert_equal "2.34.56", outdated_gem.new_version
97
97
  end
98
98
 
99
99
  it "swaps versions over 10 in the wrong order" do
100
- gem = OutdatedGem.new("x")
101
- gem.set_versions "1.10.0", "1.9.3"
102
- assert_equal "1.9.3", gem.old_version
103
- assert_equal "1.10.0", gem.new_version
100
+ outdated_gem = OutdatedGem.new("x")
101
+ outdated_gem.set_versions "1.10.0", "1.9.3"
102
+ assert_equal "1.9.3", outdated_gem.old_version
103
+ assert_equal "1.10.0", outdated_gem.new_version
104
104
  end
105
105
 
106
106
  it "swaps versions with master" do
107
- gem = OutdatedGem.new("x")
108
- gem.set_versions "master", "1.9.3"
109
- assert_equal "1.9.3", gem.old_version
110
- assert_equal "master", gem.new_version
107
+ outdated_gem = OutdatedGem.new("x")
108
+ outdated_gem.set_versions "master", "1.9.3"
109
+ assert_equal "1.9.3", outdated_gem.old_version
110
+ assert_equal "master", outdated_gem.new_version
111
111
  end
112
112
  end
113
113
 
114
114
  describe "#master" do
115
115
  it "opens master commits url" do
116
- gem = OutdatedGem.new("x")
117
- gem.stubs repo: "http://github.com/x/x"
118
- gem.expects(:open_url).with("http://github.com/x/x/commits/master")
119
- gem.master
116
+ outdated_gem = OutdatedGem.new("x")
117
+ outdated_gem.stubs repo: "http://github.com/x/x"
118
+ outdated_gem.expects(:open_url).with("http://github.com/x/x/commits/master")
119
+ outdated_gem.master
120
120
  end
121
121
  end
122
122
 
123
123
  describe "#releases" do
124
124
  it "opens releases url" do
125
- gem = OutdatedGem.new("x")
126
- gem.stubs repo: "http://github.com/x/x"
127
- gem.expects(:open_url).with("http://github.com/x/x/releases")
128
- gem.releases
125
+ outdated_gem = OutdatedGem.new("x")
126
+ outdated_gem.stubs repo: "http://github.com/x/x"
127
+ outdated_gem.expects(:open_url).with("http://github.com/x/x/releases")
128
+ outdated_gem.releases
129
129
  end
130
130
  end
131
131
 
132
132
  describe "#compare" do
133
133
  it "opens compare url" do
134
- gem = OutdatedGem.new("x", "1.2.3", "2.3.4")
135
- gem.stubs repo: "http://github.com/x/x"
136
- gem.expects(:open_url).with("http://github.com/x/x/compare/v1.2.3...v2.3.4")
137
- gem.compare
134
+ outdated_gem = OutdatedGem.new("x", "1.2.3", "2.3.4")
135
+ outdated_gem.stubs repo: "http://github.com/x/x"
136
+ outdated_gem.expects(:open_url).with("http://github.com/x/x/compare/v1.2.3...v2.3.4")
137
+ outdated_gem.compare
138
138
  end
139
139
  end
140
140
 
141
141
  describe "#open" do
142
142
  it "opens repo url" do
143
- gem = OutdatedGem.new("x")
144
- gem.stubs repo: "http://github.com/x/x"
145
- gem.expects(:open_url).with("http://github.com/x/x")
146
- gem.open
143
+ outdated_gem = OutdatedGem.new("x")
144
+ outdated_gem.stubs repo: "http://github.com/x/x"
145
+ outdated_gem.expects(:open_url).with("http://github.com/x/x")
146
+ outdated_gem.open
147
147
  end
148
148
  end
149
149
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemdiff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tee Parham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-17 00:00:00.000000000 Z
11
+ date: 2014-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  version: '0'
160
160
  requirements: []
161
161
  rubyforge_project:
162
- rubygems_version: 2.4.1
162
+ rubygems_version: 2.2.2
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: Find source repositories for ruby gems. Open, compare, and update outdated