gemline 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -4
- data/Gemfile +1 -1
- data/README.rdoc +2 -0
- data/gemline.gemspec +5 -6
- data/lib/gemline.rb +2 -3
- data/spec/acceptance_spec.rb +2 -2
- data/spec/gemline_spec.rb +4 -4
- data/spec/spec_helper.rb +1 -1
- metadata +22 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5d13b0f4bad99c5b7b27fcc55d5245516f6a7c1
|
4
|
+
data.tar.gz: 88f335133ab04f197680c2facaca7c5134b99c3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc6a44408dec2736aedff34e98736b3984ce026fd85afc446cf1170d4acc8882171e78cb80080ff5b11316a95cb33ea452b956b1e985cbe274217763115e1627
|
7
|
+
data.tar.gz: e76671bd72121f70ef25bcf998531d18b7cab3b5234ff945fc79fd4d63a9db683c588f18a5ec015530a76aae9a734bb059a55be86920710888f57845b1551715
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
= gemline
|
2
2
|
|
3
|
+
[![Build Status](https://travis-ci.org/joealba/gemline.svg?branch=master)](https://travis-ci.org/joealba/gemline)
|
4
|
+
|
3
5
|
Create a tilde-arrow Gemfile line for a gem on rubygems.org using the latest version number available according to the rubygems api.
|
4
6
|
|
5
7
|
If possible, we'll also copy that Gemfile line into the clipboard using pbcopy.
|
data/gemline.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
|
-
gem.authors = ["
|
4
|
+
gem.authors = ["Joe Alba"]
|
5
5
|
gem.email = ["joe@joealba.com"]
|
6
6
|
gem.description = %q{Grab the latest Gemfile 'gem' line for a specific Ruby gem}
|
7
7
|
gem.summary = %q{}
|
8
|
-
gem.homepage = "
|
8
|
+
gem.homepage = "https://github.com/joealba/gemline"
|
9
9
|
|
10
10
|
gem.executables = ['gemline']
|
11
11
|
gem.files = `git ls-files`.split("\n")
|
@@ -13,10 +13,9 @@ Gem::Specification.new do |gem|
|
|
13
13
|
gem.name = "gemline"
|
14
14
|
gem.require_paths = ["lib"]
|
15
15
|
|
16
|
-
gem.version = '0.4.
|
16
|
+
gem.version = '0.4.2'
|
17
17
|
gem.license = 'MIT'
|
18
18
|
|
19
|
-
gem.add_dependency "json_pure", ">= 1.7.6"
|
20
19
|
gem.add_dependency "clipboard", ">= 1.0.1"
|
21
20
|
|
22
21
|
# if RUBY_PLATFORM =~ /(win|w)32$/
|
@@ -26,6 +25,6 @@ Gem::Specification.new do |gem|
|
|
26
25
|
# end
|
27
26
|
|
28
27
|
gem.add_development_dependency "rake" # For Travis CI
|
29
|
-
gem.add_development_dependency "rspec", ">=
|
30
|
-
gem.add_development_dependency "simplecov", "
|
28
|
+
gem.add_development_dependency "rspec", ">= 3.3.0"
|
29
|
+
gem.add_development_dependency "simplecov", ">= 0.7.1"
|
31
30
|
end
|
data/lib/gemline.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'json/pure'
|
2
1
|
require 'net/https'
|
3
2
|
require 'clipboard'
|
4
3
|
|
@@ -31,7 +30,7 @@ class Gemline
|
|
31
30
|
end
|
32
31
|
|
33
32
|
def gem_not_found?
|
34
|
-
|
33
|
+
!!@json.match(/(could not be found|does not exist)/)
|
35
34
|
end
|
36
35
|
|
37
36
|
|
@@ -41,7 +40,7 @@ class Gemline
|
|
41
40
|
uri = URI.parse("https://rubygems.org/api/v1/gems/#{gem_name}.json")
|
42
41
|
http = Net::HTTP.new(uri.host, uri.port)
|
43
42
|
http.use_ssl = true
|
44
|
-
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
43
|
+
# http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
45
44
|
request = Net::HTTP::Get.new(uri.request_uri)
|
46
45
|
response = http.request(request)
|
47
46
|
response.body
|
data/spec/acceptance_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require 'stringio'
|
|
3
3
|
|
4
4
|
describe "gemline output" do
|
5
5
|
|
6
|
-
before do
|
6
|
+
before do
|
7
7
|
stub_rubygems_json_output
|
8
8
|
end
|
9
9
|
|
@@ -13,7 +13,7 @@ describe "gemline output" do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should output nothing to STDOUT on error" do
|
16
|
-
Kernel.
|
16
|
+
allow(Kernel).to receive(:exit).and_return(true)
|
17
17
|
grab_io { Gemline.query('doesnotexist') }
|
18
18
|
expect(@stdout.readlines.count).to eq(0)
|
19
19
|
end
|
data/spec/gemline_spec.rb
CHANGED
@@ -15,14 +15,14 @@ describe Gemline do
|
|
15
15
|
|
16
16
|
it "should whine when the gem you are querying does not exist" do
|
17
17
|
g = Gemline.new('doesnotexist')
|
18
|
-
g.gem_not_found
|
19
|
-
expect(g.gemline).to
|
18
|
+
expect(g.gem_not_found?).to eq true
|
19
|
+
expect(g.gemline).to eq nil
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should properly detect a blocked gem name" do
|
23
23
|
g = Gemline.new('yaml')
|
24
|
-
expect(g.gem_not_found?).to
|
25
|
-
expect(g.gemline).to
|
24
|
+
expect(g.gem_not_found?).to eq true
|
25
|
+
expect(g.gemline).to eq nil
|
26
26
|
end
|
27
27
|
|
28
28
|
it "should properly handle funny characters in the returned JSON" do
|
data/spec/spec_helper.rb
CHANGED
@@ -23,7 +23,7 @@ end
|
|
23
23
|
def stub_rubygems_json_output
|
24
24
|
Dir.glob(File.join(File.dirname(__FILE__),'samples', '*.json')).each do |f|
|
25
25
|
gem_name = $1 if f =~ /\/([\w\-]+).json$/
|
26
|
-
Gemline.
|
26
|
+
allow(Gemline).to receive(:get_rubygem_json).with(gem_name).and_return(IO.read(f))
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
metadata
CHANGED
@@ -1,97 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Joe Alba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: json_pure
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.7.6
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - '>='
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 1.7.6
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: clipboard
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
|
-
- -
|
17
|
+
- - ">="
|
32
18
|
- !ruby/object:Gem::Version
|
33
19
|
version: 1.0.1
|
34
20
|
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
38
|
-
- -
|
24
|
+
- - ">="
|
39
25
|
- !ruby/object:Gem::Version
|
40
26
|
version: 1.0.1
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: ffi
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
|
-
- -
|
31
|
+
- - ">="
|
46
32
|
- !ruby/object:Gem::Version
|
47
33
|
version: '0'
|
48
34
|
type: :runtime
|
49
35
|
prerelease: false
|
50
36
|
version_requirements: !ruby/object:Gem::Requirement
|
51
37
|
requirements:
|
52
|
-
- -
|
38
|
+
- - ">="
|
53
39
|
- !ruby/object:Gem::Version
|
54
40
|
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rake
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
|
-
- -
|
45
|
+
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
47
|
version: '0'
|
62
48
|
type: :development
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
|
-
- -
|
52
|
+
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
54
|
version: '0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: rspec
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
|
-
- -
|
59
|
+
- - ">="
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
61
|
+
version: 3.3.0
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
|
-
- -
|
66
|
+
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
68
|
+
version: 3.3.0
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: simplecov
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
86
72
|
requirements:
|
87
|
-
- -
|
73
|
+
- - ">="
|
88
74
|
- !ruby/object:Gem::Version
|
89
75
|
version: 0.7.1
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
|
-
- -
|
80
|
+
- - ">="
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: 0.7.1
|
97
83
|
description: Grab the latest Gemfile 'gem' line for a specific Ruby gem
|
@@ -102,9 +88,9 @@ executables:
|
|
102
88
|
extensions: []
|
103
89
|
extra_rdoc_files: []
|
104
90
|
files:
|
105
|
-
- .gitignore
|
106
|
-
- .rspec
|
107
|
-
- .travis.yml
|
91
|
+
- ".gitignore"
|
92
|
+
- ".rspec"
|
93
|
+
- ".travis.yml"
|
108
94
|
- Gemfile
|
109
95
|
- README.rdoc
|
110
96
|
- Rakefile
|
@@ -118,7 +104,7 @@ files:
|
|
118
104
|
- spec/samples/rails.json
|
119
105
|
- spec/samples/yaml.json
|
120
106
|
- spec/spec_helper.rb
|
121
|
-
homepage:
|
107
|
+
homepage: https://github.com/joealba/gemline
|
122
108
|
licenses:
|
123
109
|
- MIT
|
124
110
|
metadata: {}
|
@@ -128,17 +114,17 @@ require_paths:
|
|
128
114
|
- lib
|
129
115
|
required_ruby_version: !ruby/object:Gem::Requirement
|
130
116
|
requirements:
|
131
|
-
- -
|
117
|
+
- - ">="
|
132
118
|
- !ruby/object:Gem::Version
|
133
119
|
version: '0'
|
134
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
|
-
- -
|
122
|
+
- - ">="
|
137
123
|
- !ruby/object:Gem::Version
|
138
124
|
version: '0'
|
139
125
|
requirements: []
|
140
126
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
127
|
+
rubygems_version: 2.4.8
|
142
128
|
signing_key:
|
143
129
|
specification_version: 4
|
144
130
|
summary: ''
|