gem-web 0.0.1 → 0.2

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: 3527819764253846ba76c7ef7f12265a8efec11d
4
- data.tar.gz: d690323a672b83e4404ad6795e82d37a87049516
3
+ metadata.gz: 50c037cbbc3c9b9308b70eccd02f30a2713d4a83
4
+ data.tar.gz: 7a417d13ea1d583b7a9338f5c91dfef187481060
5
5
  SHA512:
6
- metadata.gz: 477d8dbc79a95da027ed28afe4f979173b83a351eb4aa49ff41087bfab855170ca8b3d91728c42aa669d630dce8fe28ad9c13f11473786ba6762276cd1fbfe3a
7
- data.tar.gz: 19eec0a3df3c2c85e259be342060927d50a94d7688306f9ff6aff0973b9b66796bed992a4c03c5ee3408e10a966b5433c78bfa2b9717d49ab5b8ad25d57f14e4
6
+ metadata.gz: aea500b0f61bc24ff62c858f7a42857560327343da426524ef7b2fa3a5413969a1a1af0499dbdd595cae82c6dc344df3808ab5bfdc18a8ba417a14789aeb8018
7
+ data.tar.gz: dc4cb80b76ffb4b863cca70fb52e001b8ba9ffe5acb3a7100760fb97ca62acf9e1b3c71aee576b01a47e01932a251e6b4aea0b078fb479b74b49d88d16823be4
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - rbx
5
+ - ruby-head
6
+ matrix:
7
+ allow_failures:
8
+ - rvm: rbx
9
+ - rvm: ruby-head
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Gem::Web
2
2
 
3
+ [![Build Status](https://secure.travis-ci.org/bitboxer/gem-web.png?branch=master)](http://travis-ci.org/bitboxer/gem-web) [![Gem Version](https://badge.fury.io/rb/gem-web.png)](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 paramter to the command.
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
@@ -2,3 +2,5 @@ require "bundler/gem_tasks"
2
2
  require 'rspec/core/rake_task'
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Gem
2
2
  module Web
3
- VERSION = "0.0.1"
3
+ VERSION = "0.2"
4
4
  end
5
5
  end
@@ -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.0.1
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-02-11 00:00:00.000000000 Z
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.0
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: