rgversion 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -3
- data/exe/rgversion +1 -1
- data/lib/rgversion/application.rb +1 -2
- data/lib/rgversion/spider.rb +17 -8
- data/lib/rgversion/terminal.rb +3 -2
- data/lib/rgversion/version.rb +2 -1
- data/rgversion.gemspec +6 -5
- metadata +10 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d8857202a062cfee1cc92cbe0c54907b54fe6cd
|
4
|
+
data.tar.gz: b193287aa676ae06a35baed306e3acd4a8bb9a3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9b6c4cf773ec4f88b7c8758c45afc5885ed698923686954cd0717def2e39448e94a3cbda87d4cde2ed2961642bd0df01242eee30ea195b46a06d182ccb3fadd
|
7
|
+
data.tar.gz: 34d80cbbe7346bfcf6b0092872e0d5de0fa52443016b189290c146b6511055cf3461ec313ed77a446377cbbb6841b8728f4be54ba354b59ac3530fa8d3d39c78
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# rgversion [![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) [![Code Climate](https://img.shields.io/codeclimate/github/vavgustov/rgversion.svg)](https://codeclimate.com/github/vavgustov/rgversion)
|
2
2
|
|
3
3
|
This library allow you to quickly copy latest semantic versions of specified gems to your clipboard. Versions will be taken from [`rubygems.org`](https://rubygems.org/). Then you can past them in your `Gemfile`.
|
4
|
-
![image](https://
|
4
|
+
![image](https://user-images.githubusercontent.com/312873/28492511-d2dbf140-6f0d-11e7-9912-beb8b94a1ca7.png)
|
5
5
|
|
6
6
|
## Installation
|
7
7
|
|
@@ -9,8 +9,11 @@ This library allow you to quickly copy latest semantic versions of specified gem
|
|
9
9
|
gem install rgversion
|
10
10
|
```
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
##### macOS / OS X
|
13
|
+
No further actions required.
|
14
|
+
|
15
|
+
##### Debian / Ubuntu
|
16
|
+
Copy to clipboard work through ``pbcopy`` and to make it work on Ubuntu / Debian you can follow these [steps](https://coderwall.com/p/oaaqwq/pbcopy-on-ubuntu-linux).
|
14
17
|
|
15
18
|
## Usage
|
16
19
|
Open terminal and execute ``rgversion`` with list of needed gems. E.g:
|
data/exe/rgversion
CHANGED
data/lib/rgversion/spider.rb
CHANGED
@@ -1,21 +1,30 @@
|
|
1
1
|
require 'nokogiri'
|
2
2
|
require 'open-uri'
|
3
3
|
|
4
|
-
module
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
module Rgversion
|
5
|
+
class Spider
|
6
|
+
def initialize(gems)
|
7
|
+
@gems = gems
|
8
|
+
end
|
9
|
+
|
10
|
+
def output
|
8
11
|
gem_text = []
|
9
|
-
|
12
|
+
@gems.each do |gem|
|
10
13
|
begin
|
11
|
-
|
12
|
-
gem_page = Nokogiri::HTML(open(gem_url))
|
13
|
-
gem_text << gem_page.at('#gemfile_text')['value']
|
14
|
+
gem_text << grab_version(gem)
|
14
15
|
rescue OpenURI::HTTPError
|
15
16
|
puts "#{gem_url} not found"
|
16
17
|
end
|
17
18
|
end
|
18
19
|
gem_text
|
19
20
|
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def grab_version(gem)
|
25
|
+
gem_url = "https://rubygems.org/gems/#{gem}"
|
26
|
+
gem_page = Nokogiri::HTML(open(gem_url))
|
27
|
+
gem_page.at('#gemfile_text')['value']
|
28
|
+
end
|
20
29
|
end
|
21
30
|
end
|
data/lib/rgversion/terminal.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
module
|
1
|
+
module Rgversion
|
2
2
|
# Terminal operations
|
3
3
|
module Terminal
|
4
4
|
def self.copy_to_clipboard
|
5
|
-
|
5
|
+
spider = RgVersion::Spider.new(ARGV)
|
6
|
+
version = spider.output
|
6
7
|
unless version.empty?
|
7
8
|
version = version.join("\n")
|
8
9
|
`echo "#{version}" | pbcopy`
|
data/lib/rgversion/version.rb
CHANGED
data/rgversion.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["vavgustov"]
|
10
10
|
spec.email = ["vavgustov@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{This library allow you to quickly copy latest semantic versions of specified gems to your clipboard.
|
12
|
+
spec.summary = %q{Copy latest semantic versions of specified gems to your clipboard.}
|
13
|
+
spec.description = %q{This library allow you to quickly copy latest semantic versions of specified gems to your clipboard.}
|
14
14
|
spec.homepage = "https://github.com/vavgustov/rgversion"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
@@ -24,8 +24,9 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
|
27
|
-
spec.add_development_dependency "bundler", "~> 1.
|
27
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
28
28
|
spec.add_development_dependency "rake", "~> 12.0"
|
29
|
-
spec.add_development_dependency "rspec", "~> 3.
|
30
|
-
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.6"
|
30
|
+
|
31
|
+
spec.add_runtime_dependency "nokogiri", "~> 1.8"
|
31
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgversion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vavgustov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.15'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.15'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,30 +44,30 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '3.
|
47
|
+
version: '3.6'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '3.
|
54
|
+
version: '3.6'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: nokogiri
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
61
|
+
version: '1.8'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '1.
|
68
|
+
version: '1.8'
|
69
69
|
description: This library allow you to quickly copy latest semantic versions of specified
|
70
|
-
gems to your clipboard.
|
70
|
+
gems to your clipboard.
|
71
71
|
email:
|
72
72
|
- vavgustov@gmail.com
|
73
73
|
executables:
|
@@ -114,6 +114,5 @@ rubyforge_project:
|
|
114
114
|
rubygems_version: 2.6.11
|
115
115
|
signing_key:
|
116
116
|
specification_version: 4
|
117
|
-
summary:
|
118
|
-
gems to your clipboard. .
|
117
|
+
summary: Copy latest semantic versions of specified gems to your clipboard.
|
119
118
|
test_files: []
|