rbcli 0.1.5 → 0.1.6

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: 0eefbfff220d04c6c6093ea0d3ec5cdd8fe93a6f02568c720ed04baddf05a25b
4
- data.tar.gz: b7d18d8c85c131cd57c7cc78d63656687896bd02f0bb4d84c8e65a0bc332a7f1
3
+ metadata.gz: 6e1fdf57f967275989d85da3af7efe4be4548c19355a38ad413b5a3eda93df29
4
+ data.tar.gz: 021efa89a89181c7ec705250824a8c6c3fc1009d9dcbcf5b3480d66f1996d47d
5
5
  SHA512:
6
- metadata.gz: 28893fa34a3e02a1f67b1279b88fb52812f07601ec9dc20662f15351d55ea06c2a4bc401a7fce9c2877b7eccfc4165183b7a6770c171084114eac2228cb49288
7
- data.tar.gz: 96cb8d64eabc9d48e511d1923e174b31c3f1d3f4fd9f74345c3cf19209ff21c3837bc6166ed97ea4b962a089cdfb9efcffea54efa923e9b3f60786e91cb0e249
6
+ metadata.gz: f35c7c37d74f54d15ca6393e5a6f9f73b34bbc957a63ff5cd5b0d5e62fdf8643e19a23ec70adab4088b2816c45329b31c309346939726c22f89de491e33b022e
7
+ data.tar.gz: deb5e7bb66af850aa3278f40826ff506302bf4ae9817cf63f8dac23a6bd0fd9db924ea684aa7ea10ef628b7fbcb6ee6893480639c3f995648423d1c05069569d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbcli (0.1.5)
4
+ rbcli (0.1.6)
5
5
  aws-sdk-dynamodb (~> 1.6)
6
6
  colorize (~> 0.8)
7
7
  deep_merge (~> 1.2)
data/README.md CHANGED
@@ -82,8 +82,8 @@ Rbcli::Configurate.me do
82
82
 
83
83
  option :name, 'Give me your name', type: :string, default: 'Foo', required: false, permitted: ['Jack', 'Jill'] # (Optional, Multiple) Add a global CLI parameter. Supported types are :string, :boolean, :integer, :float, :date, and :io. Can be called multiple times.
84
84
 
85
- autoupdate github_repo: 'akhoury6/rbcli', access_token: nil, enterprise_hostname: nil, this_version: Rbcli::VERSION, force_update: false # (Optional) Check for updates to this application at a GitHub repo. The repo must use version number tags in accordance to best practices: https://help.github.com/articles/creating-releases/
86
- autoupdate gem: 'rbcli', this_version: Rbcli::VERSION, force_update: false # (Optional) Check for updates to this application through RubyGems.org.
85
+ autoupdate github_repo: 'akhoury6/rbcli', access_token: nil, enterprise_hostname: nil, force_update: false # (Optional) Check for updates to this application at a GitHub repo. The repo must use version number tags in accordance to best practices: https://help.github.com/articles/creating-releases/
86
+ autoupdate gem: 'rbcli', force_update: false # (Optional) Check for updates to this application through RubyGems.org.
87
87
 
88
88
  default_action do |opts| # (Optional) The default code to execute when no subcommand is given. If not present, the help is shown (same as -h)
89
89
  puts "Hello, #{opts[:name]}."
@@ -374,10 +374,10 @@ Two sources are currently supported: Github (including Enterprise) and RubyGems.
374
374
 
375
375
  The GitHub update check works best when paired with GitHub's best practices on releases. See here: https://help.github.com/articles/creating-releases/
376
376
 
377
- RBCli will check your github repo's tags and compare that version number with one embedded into your code. In this example, we are leveraging the version number that we also use for RBCli's gemspec:
377
+ RBCli will check your github repo's tags and compare that version number with one you configured Rbcli with.
378
378
 
379
379
  ```ruby
380
- autoupdate github_repo: 'akhoury6/rbcli', access_token: nil, enterprise_hostname: nil, this_version: Rbcli::VERSION, force_update: false # (Optional) Check for updates to this application at a GitHub repo. The repo must use version number tags in accordance to best practices: https://help.github.com/articles/creating-releases/
380
+ autoupdate github_repo: 'akhoury6/rbcli', access_token: nil, enterprise_hostname: nil, force_update: false # (Optional) Check for updates to this application at a GitHub repo. The repo must use version number tags in accordance to best practices: https://help.github.com/articles/creating-releases/
381
381
  ```
382
382
  The `github_repo` should point to the repo using the `user/repo` syntax.
383
383
 
@@ -385,21 +385,17 @@ The `access_token` can be overridden by the user via their configuration file, s
385
385
 
386
386
  The `enterprise_hostname` setting allows you to point RBCli at a local GitHub Enterprise server.
387
387
 
388
- The `this_version` parameter should be set to the current version of the tool that the user is running. Here we leverage the default version location that is used for the RBCli gem itself. In your tool, you should replace this with your own version number.
389
-
390
388
  Setting `force_update: true` will halt execution if an update is available, forcing the user to update.
391
389
 
392
390
  ### Rubygems.org Update Check
393
391
 
394
- The Rubygems update check will check if there is a new published version of the gem on Rubygems.org.
392
+ The Rubygems update check will check if there is a new published version of the gem on Rubygems.org. The latest published version is compared to the version number you configured RBCli with.
395
393
 
396
394
  ```ruby
397
- autoupdate gem: 'rbcli', this_version: Rbcli::VERSION, force_update: false # (Optional) Check for updates to this application through RubyGems.org.
395
+ autoupdate gem: 'rbcli', force_update: false # (Optional) Check for updates to this application through RubyGems.org.
398
396
  ```
399
397
 
400
398
  The `gem` parameter should simply state the name of the gem.
401
-
402
- The `this_version` parameter should be set to the current version of the tool that the user is running. Here we leverage the default version location that is used for the RBCli gem itself. In your tool, you should replace this with your own version number.
403
399
 
404
400
  Setting `force_update: true` will halt execution if an update is available, forcing the user to update.
405
401
 
data/examples/mytool CHANGED
@@ -22,8 +22,8 @@ Rbcli::Configurate.me do
22
22
 
23
23
  option :name, 'Give me your name', type: :string, default: 'Foo', required: false, permitted: ['Jack', 'Jill'] # (Optional, Multiple) Add a global CLI parameter. Supported types are :string, :boolean, :integer, :float, :date, and :io. Can be called multiple times.
24
24
 
25
- autoupdate github_repo: 'akhoury6/rbcli', access_token: nil, enterprise_hostname: nil, this_version: Rbcli::VERSION, force_update: false # (Optional) Check for updates to this application at a GitHub repo. The repo must use version number tags in accordance to best practices: https://help.github.com/articles/creating-releases/
26
- autoupdate gem: 'rbcli', this_version: Rbcli::VERSION, force_update: false # (Optional) Check for updates to this application through RubyGems.org.
25
+ autoupdate github_repo: 'akhoury6/rbcli', access_token: nil, enterprise_hostname: nil, force_update: false # (Optional) Check for updates to this application at a GitHub repo. The repo must use version number tags in accordance to best practices: https://help.github.com/articles/creating-releases/
26
+ autoupdate gem: 'rbcli', force_update: false # (Optional) Check for updates to this application through RubyGems.org.
27
27
 
28
28
  default_action do |opts| # (Optional) The default code to execute when no subcommand is given. If not present, the help is shown (same as -h)
29
29
  puts "Hello, #{opts[:name]}."
@@ -1,13 +1,13 @@
1
1
  module Rbcli::Configurate
2
- def self.autoupdate gem: nil, github_repo: nil, access_token: nil, enterprise_hostname: nil, this_version: nil, force_update: false
2
+ def self.autoupdate gem: nil, github_repo: nil, access_token: nil, enterprise_hostname: nil, force_update: false
3
3
  raise StandardError.new "Autoupdater can not have both a gem and git target defined. Please pick one." if gem and giturl
4
4
  raise StandardError.new "Only one autoupdater can be defined." if @data[:autoupdater]
5
5
  if gem
6
6
  #Rbcli::Autoupdate::GemUpdater.save_defaults
7
- @data[:autoupdater] = Rbcli::Autoupdate::GemUpdater.new gem, this_version, force_update
7
+ @data[:autoupdater] = Rbcli::Autoupdate::GemUpdater.new gem, force_update
8
8
  else
9
9
  Rbcli::Autoupdate::GithubUpdater.save_defaults
10
- @data[:autoupdater] = Rbcli::Autoupdate::GithubUpdater.new github_repo, access_token, enterprise_hostname, this_version, force_update
10
+ @data[:autoupdater] = Rbcli::Autoupdate::GithubUpdater.new github_repo, access_token, enterprise_hostname, force_update
11
11
  end
12
12
  @data[:autoupdater].show_message if @data[:autoupdater].update_available?
13
13
  end
@@ -27,11 +27,11 @@ module Rbcli::Autoupdate
27
27
 
28
28
  def update_available?
29
29
  @latest_version = get_latest_version
30
- Gem::Version.new(@latest_version) > Gem::Version.new(@this_version)
30
+ Gem::Version.new(@latest_version) > Gem::Version.new(Rbcli.configuration[:version])
31
31
  end
32
32
 
33
33
  def show_message
34
- puts "WARNING: An update is available to #{Rbcli::Configurate::configuration[:scriptname]}. You are currently running version #{@this_version}; the latest is #{@latest_version || get_latest_version}."
34
+ puts "WARNING: An update is available to #{Rbcli::Configurate::configuration[:scriptname]}. You are currently running version #{Rbcli.configuration[:version]}; the latest is #{@latest_version || get_latest_version}."
35
35
  puts update_message
36
36
  puts "\n"
37
37
  if @force_update
@@ -5,10 +5,9 @@ module Rbcli::Autoupdate
5
5
  class GemUpdater
6
6
  include Common
7
7
 
8
- def initialize gemname, this_version, force_update
8
+ def initialize gemname, force_update
9
9
  @gemname = gemname
10
10
  @uri = URI.parse "https://rubygems.org/api/v1/versions/#{gemname}/latest.json"
11
- @this_version = this_version
12
11
  @force_update = force_update
13
12
  end
14
13
 
@@ -4,9 +4,8 @@ module Rbcli::Autoupdate
4
4
  class GithubUpdater
5
5
  include Common
6
6
 
7
- def initialize reponame, access_token, enterprise_hostname, this_version, force_update
7
+ def initialize reponame, access_token, enterprise_hostname, force_update
8
8
  @reponame = reponame
9
- @this_version = this_version
10
9
  @force_update = force_update
11
10
 
12
11
  access_token = Rbcli.config.key?(:github_updatecheck) ? (Rbcli.config[:github_updatecheck][:access_token] || access_token) : access_token
data/lib/rbcli/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rbcli
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Khoury