rgversion 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e6833c25e948b42bf4a02695842de1037bbdb9a7
4
+ data.tar.gz: 53ad829258b204c9cdb42a18482ba63e1274b291
5
+ SHA512:
6
+ metadata.gz: 55fe7bffd578b571cf5957610db11e305eb222b5e5135a451479e277d6774f7e950c79fe5e016756ed4be46f9c79e883ee31277e2d7cc91f92bf762b8d959cb6
7
+ data.tar.gz: e5728333e36c02d3ee992917d53610dcfb2749c2efcc1d7de5ecccaf15d451d2aecd3ba54585ff7bfefae6793e2a88bd77ed4978fb13a566d875e5ff15d534cd
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,8 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.1.10
5
+ - 2.2.7
6
+ - 2.3.4
7
+ - 2.4.1
8
+ before_install: gem install bundler -v 1.14.6
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rgversion.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 vavgustov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # Rgversion
2
+
3
+ TODO: Coming soon...
4
+
5
+ ## Installation
6
+
7
+ TODO: Coming soon...
8
+
9
+ ## Usage
10
+
11
+ TODO: Coming soon...
12
+
13
+ ## Code Status
14
+ [![Build Status](https://travis-ci.org/vavgustov/rgversion.svg?branch=master)](https://travis-ci.org/vavgustov/rgversion)
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "rgversion"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/exe/rgversion ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "rgversion"
5
+
6
+ RgVersion::Application.run
@@ -0,0 +1,8 @@
1
+ module RgVersion
2
+ # Main application
3
+ module Application
4
+ def self.run
5
+ RgVersion::Terminal.copy_to_clipboard
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,21 @@
1
+ require 'nokogiri'
2
+ require 'open-uri'
3
+
4
+ module RgVersion
5
+ # Spider take content from https://rubygems.org/
6
+ module Spider
7
+ def self.grab_version
8
+ gem_text = []
9
+ ARGV.each do |arg|
10
+ begin
11
+ gem_url = "https://rubygems.org/gems/#{arg}"
12
+ gem_page = Nokogiri::HTML(open(gem_url))
13
+ gem_text << gem_page.at('#gemfile_text')['value']
14
+ rescue OpenURI::HTTPError
15
+ puts "#{gem_url} not found"
16
+ end
17
+ end
18
+ gem_text
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,13 @@
1
+ module RgVersion
2
+ # Terminal operations
3
+ module Terminal
4
+ def self.copy_to_clipboard
5
+ version = RgVersion::Spider.grab_version
6
+ unless version.empty?
7
+ version = version.join("\n")
8
+ `echo "#{version}" | pbcopy`
9
+ puts "#{version}\n\nCopied to your clipboard!"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,3 @@
1
+ module Rgversion
2
+ VERSION = "0.0.1"
3
+ end
data/lib/rgversion.rb ADDED
@@ -0,0 +1,4 @@
1
+ require 'rgversion/version'
2
+ require 'rgversion/application'
3
+ require 'rgversion/spider'
4
+ require 'rgversion/terminal'
data/rgversion.gemspec ADDED
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rgversion/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rgversion"
8
+ spec.version = Rgversion::VERSION
9
+ spec.authors = ["vavgustov"]
10
+ spec.email = ["vavgustov@gmail.com"]
11
+
12
+ spec.summary = %q{rgversion is a library to quickly copy to clipboard latest version for the specific gem.}
13
+ spec.description = %q{rgversion is a library to quickly copy to clipboard latest version for the specific gem.}
14
+ spec.homepage = "https://github.com/vavgustov/rgversion"
15
+ spec.license = "MIT"
16
+
17
+ spec.required_ruby_version = '>= 2.1.0'
18
+
19
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
20
+ f.match(%r{^(test|spec|features)/})
21
+ end
22
+
23
+ spec.bindir = "exe"
24
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
+ spec.require_paths = ["lib"]
26
+
27
+ spec.add_development_dependency "bundler", "~> 1.14"
28
+ spec.add_development_dependency "rake", "~> 12.0"
29
+ spec.add_development_dependency "rspec", "~> 3.5"
30
+ spec.add_runtime_dependency "nokogiri", "~> 1.7"
31
+ end
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rgversion
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - vavgustov
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-04-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.14'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.14'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '12.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '12.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: nokogiri
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.7'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.7'
69
+ description: rgversion is a library to quickly copy to clipboard latest version for
70
+ the specific gem.
71
+ email:
72
+ - vavgustov@gmail.com
73
+ executables:
74
+ - rgversion
75
+ extensions: []
76
+ extra_rdoc_files: []
77
+ files:
78
+ - ".gitignore"
79
+ - ".rspec"
80
+ - ".travis.yml"
81
+ - Gemfile
82
+ - LICENSE.txt
83
+ - README.md
84
+ - Rakefile
85
+ - bin/console
86
+ - bin/setup
87
+ - exe/rgversion
88
+ - lib/rgversion.rb
89
+ - lib/rgversion/application.rb
90
+ - lib/rgversion/spider.rb
91
+ - lib/rgversion/terminal.rb
92
+ - lib/rgversion/version.rb
93
+ - rgversion.gemspec
94
+ homepage: https://github.com/vavgustov/rgversion
95
+ licenses:
96
+ - MIT
97
+ metadata: {}
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: 2.1.0
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project:
114
+ rubygems_version: 2.6.11
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: rgversion is a library to quickly copy to clipboard latest version for the
118
+ specific gem.
119
+ test_files: []