gem-web 0.0.1 → 0.2
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/.travis.yml +9 -0
- data/README.md +3 -1
- data/Rakefile +2 -0
- data/lib/gem/web/executor.rb +12 -0
- data/lib/gem/web/version.rb +1 -1
- data/lib/rubygems/commands/web_command.rb +6 -0
- data/spec/gem/web/executor_spec.rb +10 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50c037cbbc3c9b9308b70eccd02f30a2713d4a83
|
4
|
+
data.tar.gz: 7a417d13ea1d583b7a9338f5c91dfef187481060
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aea500b0f61bc24ff62c858f7a42857560327343da426524ef7b2fa3a5413969a1a1af0499dbdd595cae82c6dc344df3808ab5bfdc18a8ba417a14789aeb8018
|
7
|
+
data.tar.gz: dc4cb80b76ffb4b863cca70fb52e001b8ba9ffe5acb3a7100760fb97ca62acf9e1b3c71aee576b01a47e01932a251e6b4aea0b078fb479b74b49d88d16823be4
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Gem::Web
|
2
2
|
|
3
|
+
[](http://travis-ci.org/bitboxer/gem-web) [](http://badge.fury.io/rb/gem-web)
|
4
|
+
|
3
5
|
This gem plugin opens the webpage for a gem. As default it tries
|
4
6
|
to find the github page.
|
5
7
|
|
@@ -14,7 +16,7 @@ To open the github page of the rails gem enter this:
|
|
14
16
|
$ gem web rails
|
15
17
|
|
16
18
|
You could also open the documentation or the webpage that is defined in the gemspec by
|
17
|
-
adding a
|
19
|
+
adding a parameter to the command.
|
18
20
|
|
19
21
|
Options:
|
20
22
|
-g, --github Open github page of gem, this searches all urls for a github page. This is the default.
|
data/Rakefile
CHANGED
data/lib/gem/web/executor.rb
CHANGED
@@ -13,6 +13,10 @@ module Gem
|
|
13
13
|
find_page(gem, "documentation_uri")
|
14
14
|
elsif options[:webpage]
|
15
15
|
find_page(gem, "homepage_uri")
|
16
|
+
elsif options[:rubygems]
|
17
|
+
open_rubygems(gem)
|
18
|
+
elsif options[:rubytoolbox]
|
19
|
+
open_rubytoolbox(gem)
|
16
20
|
else
|
17
21
|
find_github(gem)
|
18
22
|
end
|
@@ -51,6 +55,14 @@ module Gem
|
|
51
55
|
Launchy.open(uri)
|
52
56
|
end
|
53
57
|
|
58
|
+
def open_rubygems(gem)
|
59
|
+
Launchy.open("https://rubygems.org/gems/#{gem}")
|
60
|
+
end
|
61
|
+
|
62
|
+
def open_rubytoolbox(gem)
|
63
|
+
Launchy.open("https://www.ruby-toolbox.com/projects/#{gem}")
|
64
|
+
end
|
65
|
+
|
54
66
|
end
|
55
67
|
end
|
56
68
|
end
|
data/lib/gem/web/version.rb
CHANGED
@@ -21,6 +21,12 @@ class Gem::Commands::WebCommand < Gem::Command
|
|
21
21
|
add_option("-w", "--webpage", "Open webpage of gem") do |v|
|
22
22
|
options[:webpage] = v
|
23
23
|
end
|
24
|
+
add_option("-r", "--rubygems", "Open the rubygems page of a gem") do |v|
|
25
|
+
options[:rubygems] = v
|
26
|
+
end
|
27
|
+
add_option("-t", "--rubytoolbox", "Open the ruby toolbox page of a gem") do |v|
|
28
|
+
options[:rubytoolbox] = v
|
29
|
+
end
|
24
30
|
end
|
25
31
|
|
26
32
|
def arguments
|
@@ -30,4 +30,14 @@ describe Gem::Web::Executor do
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
+
it "should open rubygems" do
|
34
|
+
expect(Launchy).to receive(:open).with("https://rubygems.org/gems/rails")
|
35
|
+
Gem::Web::Executor.new.open_page("rails", {rubygems: true})
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should open rubytoolbox" do
|
39
|
+
expect(Launchy).to receive(:open).with("https://www.ruby-toolbox.com/projects/rails")
|
40
|
+
Gem::Web::Executor.new.open_page("rails", {rubytoolbox: true})
|
41
|
+
end
|
42
|
+
|
33
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bodo Tasche
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: launchy
|
@@ -116,6 +116,7 @@ extensions: []
|
|
116
116
|
extra_rdoc_files: []
|
117
117
|
files:
|
118
118
|
- ".gitignore"
|
119
|
+
- ".travis.yml"
|
119
120
|
- Gemfile
|
120
121
|
- LICENSE.txt
|
121
122
|
- README.md
|
@@ -152,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
152
153
|
version: '0'
|
153
154
|
requirements: []
|
154
155
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.2.
|
156
|
+
rubygems_version: 2.2.2
|
156
157
|
signing_key:
|
157
158
|
specification_version: 4
|
158
159
|
summary: Adds a web command for gem
|
@@ -163,4 +164,3 @@ test_files:
|
|
163
164
|
- spec/fixtures/vcr_cassettes/sourecode.yml
|
164
165
|
- spec/gem/web/executor_spec.rb
|
165
166
|
- spec/spec_helper.rb
|
166
|
-
has_rdoc:
|