rgversion 1.1.7 → 1.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebc6b704de430f1b6d61319c48cc9efa2cd536728a8f34f74e99b93f003771c2
4
- data.tar.gz: 4fb8dc658b6d7b890fadc123ff010381c4047a63bcfe221d1ea95c3d258fb82c
3
+ metadata.gz: 27afd4dde1a0364868d262226fb2bb4ccfc433293498e2fbd4c79a43dad06e02
4
+ data.tar.gz: a1ac709c3d5403b6d55adbe21657b936b9a17056e3e7db9b24cda0c3ff55732c
5
5
  SHA512:
6
- metadata.gz: e90ed9e8fa6c14c1dfb955d73920c30157805c20c14fe03b9faad6a143c2e2f5027415ea57bce0663cac27d06d2c930e8b97c0283fec6d32ed1d21248d17e07b
7
- data.tar.gz: 950f5ec13a968964e038eebfbfa92f2a539473f3f0fb76f0125fa1a70aea7546f1d48715ee2c92d6cab3ef6f2dfa210afb498567f15687ee18bba7d03184a333
6
+ metadata.gz: f674f763f29f7b7022b09946d35eb30b252677a4df25db8dcd9134e67bf6c103aa210c5304d46f6957977fa1a1a5b533335bb151b228edaebeae4523d8d81400
7
+ data.tar.gz: c52e9d246d074df6758000d27e4d13a561decac996936d2a84701025b8534dc0b1fc7370e4fca4391b35057a258cb00f5a94d93276d8173621a1e1fef0d9c976
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Rgversion
2
2
  [![Gem](https://img.shields.io/gem/v/rgversion.svg)](https://rubygems.org/gems/rgversion) [![Build Status](https://img.shields.io/travis/vavgustov/rgversion/master.svg)](https://travis-ci.org/vavgustov/rgversion) [![Maintainability](https://api.codeclimate.com/v1/badges/b5d59c13b4d649c321ea/maintainability)](https://codeclimate.com/github/vavgustov/rgversion/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/b5d59c13b4d649c321ea/test_coverage)](https://codeclimate.com/github/vavgustov/rgversion/test_coverage)
3
3
 
4
- This library allow you to copy latest semantic versions of specified gems from terminal to your clipboard.
5
- Versions will be taken from [`rubygems.org`](https://rubygems.org/). Then you can past them in your `Gemfile`
6
- or whatever you want.
4
+ This gem allow you to add to clipboard latest semantic versions of specified gems from terminal. Then you can past
5
+ them in your `Gemfile` or whatever you want. [Giphy here](https://github.com/vavgustov/rgversion/wiki/Giphy).
6
+
7
7
  ![image](https://user-images.githubusercontent.com/312873/28492511-d2dbf140-6f0d-11e7-9912-beb8b94a1ca7.png)
8
8
 
9
9
  ## Installation
@@ -12,14 +12,14 @@ or whatever you want.
12
12
  gem install rgversion
13
13
  ```
14
14
 
15
- ### macOS / OS X
16
- No further actions required.=
15
+ ##### macOS / OS X
16
+ No further actions required.
17
17
 
18
- ### Ubuntu / Debian
19
- You may need to install xclip for clipboard feature:
18
+ ##### Ubuntu / Debian
19
+ You may need to install `xclip` for clipboard feature:
20
20
  ```bash
21
21
  sudo apt-get install xclip
22
- ```
22
+ ```
23
23
 
24
24
  ## Usage
25
25
  Open terminal and execute ``rgversion`` with list of needed gems. E.g:
@@ -28,7 +28,7 @@ Open terminal and execute ``rgversion`` with list of needed gems. E.g:
28
28
  rgversion rails puma pg
29
29
  ```
30
30
 
31
- After that semantic version of gem(s) will be copied to your clipboard.
31
+ Then just past your clipboard to Gemfile.
32
32
 
33
33
  ## License
34
34
 
data/exe/rgversion CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "rgversion"
3
+ require_relative "../lib/rgversion"
4
4
 
5
5
  app = Rgversion::Application.new(ARGV, Rgversion::Settings::SELECTOR)
6
6
  app.run
@@ -1,4 +1,5 @@
1
1
  module Rgversion
2
+ class GemNotHosted < StandardError; end
2
3
  class NoArguments < StandardError; end
3
4
  class WrongSelector < StandardError; end
4
5
  end
@@ -16,7 +16,7 @@ module Rgversion
16
16
  @gems.each do |gem|
17
17
  begin
18
18
  lines << grab_version(gem)
19
- rescue OpenURI::HTTPError
19
+ rescue OpenURI::HTTPError, GemNotHosted
20
20
  errors << "#{gem} not found"
21
21
  end
22
22
  end
@@ -35,7 +35,10 @@ module Rgversion
35
35
  def grab_version(gem)
36
36
  gem_url = "https://rubygems.org/gems/#{gem}"
37
37
  gem_page = Nokogiri::HTML(open(gem_url))
38
- raise WrongSelector, error_messages(:selector) if gem_page.at(@selector).nil?
38
+ if gem_page.at(@selector).nil?
39
+ raise GemNotHosted if gem_page.at("#markup").text().include? "This gem is not currently hosted on"
40
+ raise WrongSelector, error_messages(:selector)
41
+ end
39
42
  gem_page.at(@selector)["value"]
40
43
  end
41
44
  end
@@ -1,4 +1,4 @@
1
1
  module Rgversion
2
- VERSION = "1.1.7".freeze
3
- PREVIOUS_VERSION = "1.1.6".freeze
2
+ VERSION = "1.1.8".freeze
3
+ PREVIOUS_VERSION = "1.1.7".freeze
4
4
  end
data/lib/rgversion.rb CHANGED
@@ -1,17 +1,11 @@
1
1
  require "active_support/core_ext/object/blank"
2
- require "active_support/dependencies/autoload"
3
2
  require "awesome_print"
4
3
  require "os"
5
- require "rgversion/exceptions"
6
- require "rgversion/version"
7
-
8
- module Rgversion
9
- extend ActiveSupport::Autoload
10
-
11
- autoload :Application
12
- autoload :Clipboard
13
- autoload :Instruction
14
- autoload :Settings
15
- autoload :Spider
16
- autoload :Terminal
17
- end
4
+ require_relative "rgversion/application"
5
+ require_relative "rgversion/clipboard"
6
+ require_relative "rgversion/exceptions"
7
+ require_relative "rgversion/instruction"
8
+ require_relative "rgversion/settings"
9
+ require_relative "rgversion/spider"
10
+ require_relative "rgversion/terminal"
11
+ require_relative "rgversion/version"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgversion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - vavgustov