gems-cli 0.1.2 → 0.1.3
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/.rspec +3 -0
- data/.travis.yml +6 -0
- data/Gemfile.lock +15 -18
- data/README.md +2 -0
- data/Rakefile +2 -31
- data/gems-cli.gemspec +2 -2
- data/lib/gems-cli/version.rb +1 -1
- data/spec/gems-cli/paginator_spec.rb +90 -0
- data/spec/spec_helper.rb +89 -0
- metadata +10 -8
- data/test/default_test.rb +0 -14
- data/test/test_helper.rb +0 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6a8900fd82b7e823c789fb04fd5c873665df6bbd
|
|
4
|
+
data.tar.gz: a5ade079b7bf16149c21f47cb00761968ddf6776
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8e5f4df4416d7a19ad89c47c6261befd8c022543e64ac116c08a9249900a7c7e65f7a0ee5017a7677eb7319e96a928ecff9190d00b0c0ec729cf8bd80a020e22
|
|
7
|
+
data.tar.gz: f98f578d04e5bd1a995a159f22ad203333f85d0d8caeda180db34291b06a13125b8aaa33517bd0b4a215d5f7ab1d24d1fe4079587b38e7af697fa30c6ac2baba
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
gems-cli (0.1.
|
|
4
|
+
gems-cli (0.1.3)
|
|
5
5
|
clipboard (= 1.0.5)
|
|
6
6
|
gems (= 0.8.3)
|
|
7
7
|
gli (= 2.12.2)
|
|
@@ -12,31 +12,28 @@ PATH
|
|
|
12
12
|
GEM
|
|
13
13
|
remote: https://rubygems.org/
|
|
14
14
|
specs:
|
|
15
|
-
byebug (3.5.1)
|
|
16
|
-
columnize (~> 0.8)
|
|
17
|
-
debugger-linecache (~> 1.2)
|
|
18
|
-
slop (~> 3.6)
|
|
19
15
|
clipboard (1.0.5)
|
|
20
|
-
|
|
21
|
-
columnize (0.8.9)
|
|
22
|
-
debugger-linecache (1.2.0)
|
|
16
|
+
diff-lcs (1.2.5)
|
|
23
17
|
gems (0.8.3)
|
|
24
18
|
gli (2.12.2)
|
|
25
19
|
highline (1.6.21)
|
|
26
20
|
json (1.8.1)
|
|
27
|
-
method_source (0.8.2)
|
|
28
|
-
pry (0.10.1)
|
|
29
|
-
coderay (~> 1.1.0)
|
|
30
|
-
method_source (~> 0.8.1)
|
|
31
|
-
slop (~> 3.4)
|
|
32
|
-
pry-byebug (2.0.0)
|
|
33
|
-
byebug (~> 3.4)
|
|
34
|
-
pry (~> 0.10)
|
|
35
21
|
rainbow (2.0.0)
|
|
36
22
|
rake (10.3.2)
|
|
37
23
|
rdoc (4.1.2)
|
|
38
24
|
json (~> 1.4)
|
|
39
|
-
|
|
25
|
+
rspec (3.1.0)
|
|
26
|
+
rspec-core (~> 3.1.0)
|
|
27
|
+
rspec-expectations (~> 3.1.0)
|
|
28
|
+
rspec-mocks (~> 3.1.0)
|
|
29
|
+
rspec-core (3.1.7)
|
|
30
|
+
rspec-support (~> 3.1.0)
|
|
31
|
+
rspec-expectations (3.1.2)
|
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
33
|
+
rspec-support (~> 3.1.0)
|
|
34
|
+
rspec-mocks (3.1.3)
|
|
35
|
+
rspec-support (~> 3.1.0)
|
|
36
|
+
rspec-support (3.1.2)
|
|
40
37
|
will_paginate (3.0.7)
|
|
41
38
|
|
|
42
39
|
PLATFORMS
|
|
@@ -44,6 +41,6 @@ PLATFORMS
|
|
|
44
41
|
|
|
45
42
|
DEPENDENCIES
|
|
46
43
|
gems-cli!
|
|
47
|
-
pry-byebug (~> 2.0.0)
|
|
48
44
|
rake (~> 10.3.2)
|
|
49
45
|
rdoc (~> 4.1.2)
|
|
46
|
+
rspec (~> 3.1.0)
|
data/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
gems-cli
|
|
2
2
|
========
|
|
3
3
|
|
|
4
|
+
[](https://travis-ci.org/chaserx/gems-cli)
|
|
5
|
+
|
|
4
6
|
Using the [gems](https://github.com/rubygems/gems) gem to lookup Ruby Gems on
|
|
5
7
|
the command line. Copy formatted gem details for your project's Gemfile.
|
|
6
8
|
|
data/Rakefile
CHANGED
|
@@ -2,43 +2,14 @@ require 'rake/clean'
|
|
|
2
2
|
require 'rubygems'
|
|
3
3
|
require 'rubygems/package_task'
|
|
4
4
|
require 'rdoc/task'
|
|
5
|
-
|
|
6
|
-
require 'cucumber/rake/task'
|
|
5
|
+
|
|
7
6
|
Rake::RDocTask.new do |rd|
|
|
8
7
|
rd.main = "README.rdoc"
|
|
9
8
|
rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
|
|
10
|
-
rd.title = '
|
|
9
|
+
rd.title = 'gems-cli'
|
|
11
10
|
end
|
|
12
11
|
|
|
13
12
|
spec = eval(File.read('gems-cli.gemspec'))
|
|
14
13
|
|
|
15
14
|
Gem::PackageTask.new(spec) do |pkg|
|
|
16
15
|
end
|
|
17
|
-
CUKE_RESULTS = 'results.html'
|
|
18
|
-
CLEAN << CUKE_RESULTS
|
|
19
|
-
desc 'Run features'
|
|
20
|
-
Cucumber::Rake::Task.new(:features) do |t|
|
|
21
|
-
opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
|
|
22
|
-
opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
|
|
23
|
-
t.cucumber_opts = opts
|
|
24
|
-
t.fork = false
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
desc 'Run features tagged as work-in-progress (@wip)'
|
|
28
|
-
Cucumber::Rake::Task.new('features:wip') do |t|
|
|
29
|
-
tag_opts = ' --tags ~@pending'
|
|
30
|
-
tag_opts = ' --tags @wip'
|
|
31
|
-
t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
|
|
32
|
-
t.fork = false
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
task :cucumber => :features
|
|
36
|
-
task 'cucumber:wip' => 'features:wip'
|
|
37
|
-
task :wip => 'features:wip'
|
|
38
|
-
require 'rake/testtask'
|
|
39
|
-
Rake::TestTask.new do |t|
|
|
40
|
-
t.libs << "test"
|
|
41
|
-
t.test_files = FileList['test/*_test.rb']
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
task :default => [:test,:features]
|
data/gems-cli.gemspec
CHANGED
|
@@ -17,11 +17,11 @@ spec = Gem::Specification.new do |s|
|
|
|
17
17
|
s.rdoc_options << '--title' << 'gems-cli' << '--main' << 'README.rdoc' << '-ri'
|
|
18
18
|
s.bindir = 'bin'
|
|
19
19
|
s.executables << 'gems'
|
|
20
|
-
s.required_ruby_version = '>=
|
|
20
|
+
s.required_ruby_version = '>= 2.0'
|
|
21
21
|
s.post_install_message = "Thanks for installing! \ngems-cli usage: `gems s chase`"
|
|
22
22
|
s.add_development_dependency('rake', '~> 10.3.2')
|
|
23
23
|
s.add_development_dependency('rdoc', '~> 4.1.2')
|
|
24
|
-
s.add_development_dependency('
|
|
24
|
+
s.add_development_dependency('rspec', '~> 3.1.0')
|
|
25
25
|
|
|
26
26
|
s.add_runtime_dependency('gli','2.12.2')
|
|
27
27
|
s.add_runtime_dependency('gems','0.8.3')
|
data/lib/gems-cli/version.rb
CHANGED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'gems-cli/paginator'
|
|
3
|
+
|
|
4
|
+
describe Paginator do
|
|
5
|
+
subject { Paginator.new(ary: (1..100).to_a)}
|
|
6
|
+
|
|
7
|
+
describe '#first_page?' do
|
|
8
|
+
it 'returns true if on the first page' do
|
|
9
|
+
expect(subject.first_page?).to eq(true)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
describe '#last_page?' do
|
|
14
|
+
it 'returns true if on the last page' do
|
|
15
|
+
subject.page = subject.pages
|
|
16
|
+
expect(subject.last_page?).to eq(true)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
describe '#first_page' do
|
|
21
|
+
it 'returns 1..10' do
|
|
22
|
+
expect(subject.first_page).to eq((1..10).to_a)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it 'sets subject.page to 1' do
|
|
26
|
+
subject.first_page
|
|
27
|
+
expect(subject.page).to eq(1)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
describe '#last_page' do
|
|
32
|
+
it 'returns 91..100' do
|
|
33
|
+
expect(subject.last_page).to eq((91..100).to_a)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
describe '#next_page' do
|
|
38
|
+
before { subject.next_page }
|
|
39
|
+
|
|
40
|
+
context 'when on page 1' do
|
|
41
|
+
it 'returns 11..20' do
|
|
42
|
+
expect(subject.current_page).to eq((11..20).to_a)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it 'sets subject.page to 2' do
|
|
46
|
+
expect(subject.page).to eq(2)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
context 'when on page 2' do
|
|
51
|
+
subject { Paginator.new(ary: (1..100).to_a, page: 2)}
|
|
52
|
+
|
|
53
|
+
before { subject.next_page }
|
|
54
|
+
|
|
55
|
+
it 'returns 21..30' do
|
|
56
|
+
expect(subject.current_page).to eq((21..30).to_a)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
it 'sets subject.page to 3' do
|
|
60
|
+
expect(subject.page).to eq(3)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
describe '#previous_page' do
|
|
66
|
+
before { subject.previous_page }
|
|
67
|
+
|
|
68
|
+
context 'when on page 1' do
|
|
69
|
+
it 'returns 1..10' do
|
|
70
|
+
expect(subject.current_page).to eq((1..10).to_a)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
it 'sets subject.page to 1' do
|
|
74
|
+
expect(subject.page).to eq(1)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
context 'when on page 2' do
|
|
79
|
+
subject { Paginator.new(ary: (1..100).to_a, page: 2)}
|
|
80
|
+
|
|
81
|
+
it 'returns 1..10' do
|
|
82
|
+
expect(subject.current_page).to eq((1..10).to_a)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
it 'sets subject.page to 1' do
|
|
86
|
+
expect(subject.page).to eq(1)
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
|
5
|
+
#
|
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
|
9
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
|
10
|
+
# a separate helper file that requires the additional dependencies and performs
|
|
11
|
+
# the additional setup, and require it from the spec files that actually need it.
|
|
12
|
+
#
|
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
|
14
|
+
# users commonly want.
|
|
15
|
+
#
|
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
17
|
+
RSpec.configure do |config|
|
|
18
|
+
# rspec-expectations config goes here. You can use an alternate
|
|
19
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
|
20
|
+
# assertions if you prefer.
|
|
21
|
+
config.expect_with :rspec do |expectations|
|
|
22
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
|
23
|
+
# and `failure_message` of custom matchers include text for helper methods
|
|
24
|
+
# defined using `chain`, e.g.:
|
|
25
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
|
26
|
+
# # => "be bigger than 2 and smaller than 4"
|
|
27
|
+
# ...rather than:
|
|
28
|
+
# # => "be bigger than 2"
|
|
29
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
|
33
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
|
34
|
+
config.mock_with :rspec do |mocks|
|
|
35
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
|
36
|
+
# a real object. This is generally recommended, and will default to
|
|
37
|
+
# `true` in RSpec 4.
|
|
38
|
+
mocks.verify_partial_doubles = true
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# The settings below are suggested to provide a good initial experience
|
|
42
|
+
# with RSpec, but feel free to customize to your heart's content.
|
|
43
|
+
#=begin
|
|
44
|
+
# These two settings work together to allow you to limit a spec run
|
|
45
|
+
# to individual examples or groups you care about by tagging them with
|
|
46
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
|
47
|
+
# get run.
|
|
48
|
+
# config.filter_run :focus
|
|
49
|
+
# config.run_all_when_everything_filtered = true
|
|
50
|
+
|
|
51
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
|
52
|
+
# For more details, see:
|
|
53
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
|
54
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
|
55
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
|
56
|
+
# config.disable_monkey_patching!
|
|
57
|
+
|
|
58
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
|
59
|
+
# be too noisy due to issues in dependencies.
|
|
60
|
+
# config.warnings = true
|
|
61
|
+
|
|
62
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
|
63
|
+
# file, and it's useful to allow more verbose output when running an
|
|
64
|
+
# individual spec file.
|
|
65
|
+
# if config.files_to_run.one?
|
|
66
|
+
# Use the documentation formatter for detailed output,
|
|
67
|
+
# unless a formatter has already been configured
|
|
68
|
+
# (e.g. via a command-line flag).
|
|
69
|
+
# config.default_formatter = 'doc'
|
|
70
|
+
# end
|
|
71
|
+
|
|
72
|
+
# Print the 10 slowest examples and example groups at the
|
|
73
|
+
# end of the spec run, to help surface which specs are running
|
|
74
|
+
# particularly slow.
|
|
75
|
+
# config.profile_examples = 10
|
|
76
|
+
|
|
77
|
+
# Run specs in random order to surface order dependencies. If you find an
|
|
78
|
+
# order dependency and want to debug it, you can fix the order by providing
|
|
79
|
+
# the seed, which is printed after each run.
|
|
80
|
+
# --seed 1234
|
|
81
|
+
config.order = :random
|
|
82
|
+
|
|
83
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
|
84
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
|
85
|
+
# test failures related to randomization by passing the same `--seed` value
|
|
86
|
+
# as the one that triggered the failure.
|
|
87
|
+
Kernel.srand config.seed
|
|
88
|
+
#=end
|
|
89
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gems-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chase Southard
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-11-
|
|
11
|
+
date: 2014-11-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -39,19 +39,19 @@ dependencies:
|
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
40
|
version: 4.1.2
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: rspec
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
47
|
+
version: 3.1.0
|
|
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:
|
|
54
|
+
version: 3.1.0
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: gli
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -147,6 +147,8 @@ extra_rdoc_files:
|
|
|
147
147
|
- gems-cli.rdoc
|
|
148
148
|
files:
|
|
149
149
|
- ".gitignore"
|
|
150
|
+
- ".rspec"
|
|
151
|
+
- ".travis.yml"
|
|
150
152
|
- CHANGELOG
|
|
151
153
|
- Gemfile
|
|
152
154
|
- Gemfile.lock
|
|
@@ -161,8 +163,8 @@ files:
|
|
|
161
163
|
- lib/gems-cli.rb
|
|
162
164
|
- lib/gems-cli/paginator.rb
|
|
163
165
|
- lib/gems-cli/version.rb
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
+
- spec/gems-cli/paginator_spec.rb
|
|
167
|
+
- spec/spec_helper.rb
|
|
166
168
|
homepage: https://github.com/chaserx/gems-cli
|
|
167
169
|
licenses:
|
|
168
170
|
- MIT
|
|
@@ -181,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
181
183
|
requirements:
|
|
182
184
|
- - ">="
|
|
183
185
|
- !ruby/object:Gem::Version
|
|
184
|
-
version: '
|
|
186
|
+
version: '2.0'
|
|
185
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
186
188
|
requirements:
|
|
187
189
|
- - ">="
|
data/test/default_test.rb
DELETED