bun 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: fb12f5eb445c643446202ce117fb8a3938210de2d06be473bc934cd65dcc7938
4
- data.tar.gz: d04e66d00b02d6a16430cc20a06b14a4060b79a69f8ce0141252c3866d3b2fec
3
+ metadata.gz: d621884082dd78c98f0cffcf7252526256f50d25d16a7d359b4938bec037af98
4
+ data.tar.gz: d1901478267385abd1ca5dd4664388c07f30419c55c3efc733fb395c0b317612
5
5
  SHA512:
6
- metadata.gz: 2c77d30d9a4bae86ff3291db8ac59e5ec4eeb44888a7c04883fd8ea95652e7b8df1c19a87f065627adf0e870853c4b406e99b18a9ad1800017c7af38ab4463e4
7
- data.tar.gz: 1ca70952a165a225a8e447d5b4b71c6fd49d7d76a5189bac17f0677940356114ad243dfc1d1f21bd83fda98f2be4cb2aaa55f7fdacc60178e2bb3824d47a6a00
6
+ metadata.gz: fea7b713f724b63378dc543e905006f9ee145283fb23435eefcddcb19e7c47b5ab0ad3d35a5ae3d2b141d85f324bc17af9109ecef5db983f81a4979b86be61f8
7
+ data.tar.gz: e5f57a7963312f8825e56b240c1e9f2ba5b2cfdd6575ff0c9af1c183b9777ce10e71529c9a509f6184622576d2f5d1be6fa36943cae4623b276b5f8ed4c8e3d7
@@ -2,8 +2,9 @@ PATH
2
2
  remote: .
3
3
  specs:
4
4
  bun (1.0.0)
5
- paint (~> 2.0.1)
6
- tty-spinner (~> 0.8.0)
5
+ bundler (~> 1.16)
6
+ paint (~> 2.0)
7
+ tty-spinner (~> 0.8)
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
@@ -38,10 +39,9 @@ PLATFORMS
38
39
 
39
40
  DEPENDENCIES
40
41
  bun!
41
- bundler (~> 1.16)
42
- pry (~> 0.11.3)
42
+ pry (~> 0.11)
43
43
  rake (~> 10.0)
44
- rspec (~> 3.7.0)
44
+ rspec (~> 3.7)
45
45
 
46
46
  BUNDLED WITH
47
47
  1.16.1
@@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_runtime_dependency "tty-spinner", "~> 0.8.0"
23
- spec.add_runtime_dependency "paint", "~> 2.0.1"
22
+ spec.add_runtime_dependency "tty-spinner", "~> 0.8"
23
+ spec.add_runtime_dependency "paint", "~> 2.0"
24
+ spec.add_runtime_dependency "bundler", "~> 1.16"
24
25
 
25
- spec.add_development_dependency "bundler", "~> 1.16"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
27
- spec.add_development_dependency "rspec", "~> 3.7.0"
28
- spec.add_development_dependency "pry", "~> 0.11.3"
27
+ spec.add_development_dependency "rspec", "~> 3.7"
28
+ spec.add_development_dependency "pry", "~> 0.11"
29
29
  end
@@ -1,66 +1,68 @@
1
1
  require "optparse"
2
2
 
3
- class Arguments
4
- def initialize(arguments)
5
- @arguments = arguments
6
- end
3
+ module Bun
4
+ class Arguments
5
+ def initialize(arguments)
6
+ @arguments = arguments
7
+ end
7
8
 
8
- attr_accessor :optimistic, :strict, :group, :skip_install, :print
9
+ attr_accessor :optimistic, :strict, :group, :skip_install, :print
9
10
 
10
- alias :strict? :strict
11
- alias :optimistic? :optimistic
12
- alias :skip_install? :skip_install
13
- alias :print? :print
11
+ alias :strict? :strict
12
+ alias :optimistic? :optimistic
13
+ alias :skip_install? :skip_install
14
+ alias :print? :print
14
15
 
15
- def empty?
16
- @arguments.empty?
17
- end
16
+ def empty?
17
+ @arguments.empty?
18
+ end
18
19
 
19
- def parse
20
- opt_parser = OptionParser.new do |opts|
21
- opts.banner = Bun::Messages::USAGE
20
+ def parse
21
+ opt_parser = OptionParser.new do |opts|
22
+ opts.banner = Bun::Messages::USAGE
22
23
 
23
- opts.on("-P", "--print", "# Just print the gem name and version and exit.") do
24
- self.print = true
25
- end
24
+ opts.on("-P", "--print", "# Just print the gem name and version and exit.") do
25
+ self.print = true
26
+ end
26
27
 
27
- opts.on("-o", "--optimistic", "# Use optimistic version range >= instead of ~>.") do
28
- self.optimistic = true
29
- end
28
+ opts.on("-o", "--optimistic", "# Use optimistic version range >= instead of ~>.") do
29
+ self.optimistic = true
30
+ end
30
31
 
31
- opts.on("-S", "--strict", "# Use strict version instead of ~> range.") do
32
- self.strict = true
33
- end
32
+ opts.on("-S", "--strict", "# Use strict version instead of ~> range.") do
33
+ self.strict = true
34
+ end
34
35
 
35
- opts.on("-d", "--development", "# Add gem to development group.") do
36
- self.group = :development
37
- end
36
+ opts.on("-d", "--development", "# Add gem to development group.") do
37
+ self.group = :development
38
+ end
38
39
 
39
- opts.on("-t", "--test", "# Add gem to test group.") do
40
- self.group = :test
41
- end
40
+ opts.on("-t", "--test", "# Add gem to test group.") do
41
+ self.group = :test
42
+ end
42
43
 
43
- opts.on("-s", "--skip-install", "# Skip the install step.") do
44
- self.skip_install = true
45
- end
44
+ opts.on("-s", "--skip-install", "# Skip the install step.") do
45
+ self.skip_install = true
46
+ end
46
47
 
47
- opts.on_tail("-h", "--help", "# Print these usage instructions.") do
48
- puts opts
49
- end
48
+ opts.on_tail("-h", "--help", "# Print these usage instructions.") do
49
+ puts opts
50
+ end
50
51
 
51
- opts.on("-v", "--version", "# Show current Bun version.") do
52
- puts Bun::VERSION
52
+ opts.on("-v", "--version", "# Show current Bun version.") do
53
+ puts Bun::VERSION
54
+ end
53
55
  end
54
- end
55
56
 
56
- begin
57
- opt_parser.parse(arguments)
58
- rescue OptionParser::InvalidOption
59
- puts opt_parser
57
+ begin
58
+ opt_parser.parse(arguments)
59
+ rescue OptionParser::InvalidOption
60
+ puts opt_parser
61
+ end
60
62
  end
61
- end
62
63
 
63
- private
64
+ private
64
65
 
65
- attr :arguments
66
+ attr :arguments
67
+ end
66
68
  end
@@ -4,4 +4,3 @@ module Bun
4
4
  class GemNotFoundError < StandardError; end
5
5
  end
6
6
  end
7
-
@@ -1,3 +1,3 @@
1
1
  module Bun
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -2,45 +2,48 @@ require "json"
2
2
  require "open-uri"
3
3
  require "tty/spinner"
4
4
 
5
- class VersionFetcher
6
- RUBYGEMS_SEARCH_URL = "https://rubygems.org/api/v1/search.json"
7
- def initialize(gem, arguments)
8
- @gem = gem
9
- @arguments = arguments
10
- end
5
+ module Bun
6
+ class VersionFetcher
7
+ RUBYGEMS_SEARCH_URL = "https://rubygems.org/api/v1/search.json"
8
+
9
+ def initialize(gem, arguments)
10
+ @gem = gem
11
+ @arguments = arguments
12
+ end
11
13
 
12
- def fetch_latest_version
13
- version = nil
14
+ def fetch_latest_version
15
+ version = nil
14
16
 
15
- with_optional_spinner do
16
- response = open("#{RUBYGEMS_SEARCH_URL}?query=#{gem}").read
17
- json_response = JSON.parse(response)
18
- latest_gem_attributes = json_response.
19
- find {|attributes| attributes["name"] == gem }
17
+ with_optional_spinner do
18
+ response = open("#{RUBYGEMS_SEARCH_URL}?query=#{gem}").read
19
+ json_response = JSON.parse(response)
20
+ latest_gem_attributes = json_response.
21
+ find {|attributes| attributes["name"] == gem }
20
22
 
21
- unless latest_gem_attributes
22
- raise ::Bun::Errors::GemNotFoundError.new("Aborting. Gem not found: #{gem}")
23
+ unless latest_gem_attributes
24
+ raise ::Bun::Errors::GemNotFoundError.new("Aborting. Gem not found: #{gem}")
25
+ end
26
+
27
+ version = latest_gem_attributes["version"]
23
28
  end
24
29
 
25
- version = latest_gem_attributes["version"]
30
+ version
26
31
  end
27
32
 
28
- version
29
- end
30
-
31
- def with_optional_spinner
32
- if arguments.print?
33
- yield
34
- else
35
- spinner = TTY::Spinner.new("[:spinner] Finding latest gem version for \"#{gem}\"...")
36
- spinner.auto_spin
37
- yield
38
- spinner.stop("Done!")
33
+ def with_optional_spinner
34
+ if arguments.print?
35
+ yield
36
+ else
37
+ spinner = TTY::Spinner.new("[:spinner] Finding latest gem version for \"#{gem}\"...")
38
+ spinner.auto_spin
39
+ yield
40
+ spinner.stop("Done!")
41
+ end
39
42
  end
40
- end
41
43
 
42
- private
44
+ private
43
45
 
44
- attr :gem
45
- attr :arguments
46
+ attr :gem
47
+ attr :arguments
48
+ end
46
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bun
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hrvoje Šimić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-07 00:00:00.000000000 Z
11
+ date: 2018-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-spinner
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.8.0
19
+ version: '0.8'
20
20
  type: :runtime
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: 0.8.0
26
+ version: '0.8'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: paint
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.1
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.0.1
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -45,7 +45,7 @@ dependencies:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.16'
48
- type: :development
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 3.7.0
75
+ version: '3.7'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 3.7.0
82
+ version: '3.7'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.11.3
89
+ version: '0.11'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.11.3
96
+ version: '0.11'
97
97
  description:
98
98
  email:
99
99
  - shime@twobucks.co