rusky 0.2.1 → 0.2.2

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
  SHA1:
3
- metadata.gz: ddac10e73676c6b1827086a80e20aa696ed54079
4
- data.tar.gz: 67564f0da000d82ea5657a6bf10bc5f49bbb299a
3
+ metadata.gz: a00a714408281d031099446610b64c09660f508b
4
+ data.tar.gz: fba6ebd6126cb2381e0663143261f1af85f2355f
5
5
  SHA512:
6
- metadata.gz: 66d771267c59ffabc2da871d3013d423d946b05de081b7260fe0899fc395c3af3d8b1871d266478c082436478861f3697325401331a22b2be4e0bbea05a11b77
7
- data.tar.gz: 603e3b097b5a4d097295bba8aff86328a6796cd9c62b5285fa06c317e8e230837e4e6bc8d32530f65cbc3e04fc7eec2b1bc81418d00362d9a29ed6e0a7828013
6
+ metadata.gz: 07b16db70461073fbc0791f5476aa81ec92b89e23477d3165b49820216bdbe7f8f0858ee6246ce526b7f1fe8cb3b87e4d6b1866380805626fa7afd561bae2fde
7
+ data.tar.gz: 84c6e65a3bc61ef46162fa58e12e20abbf5773674da0d2381ff210a0b415ef8fdecbd270cd44fa7c40fa1b590f4b1be6f5724dff4390e22c150007e486c753c1
data/README.md CHANGED
@@ -30,7 +30,7 @@ After installation, Rusky automatically creates git hook scripts in `.git/hooks`
30
30
 
31
31
  ## Usage
32
32
 
33
- 1. Add the following lines into your Rakefile. It defines rake tasks to be executed on Git hook. The task names are `"rusky:#{git_hook_name}"`.
33
+ 1. Add the following lines into your `Rakefile` (or [any other rake file](https://github.com/ruby/rake/blob/68ef9140c11d083d8bb7ee5da5b0543e3a7df73d/lib/rake/application.rb#L41-L46)). It defines rake tasks to be executed on Git hook. The task names are `"rusky:#{git_hook_name}"`.
34
34
 
35
35
  ```ruby
36
36
  require "rusky/task"
@@ -47,6 +47,23 @@ pre-push:
47
47
  - bundle exec rspec
48
48
  ```
49
49
 
50
+ ### Manual installation
51
+
52
+ Although Rusky automatically creates necessary files, it provides CLI for (un)installation as well. It would be useful when you want to retry (un)install.
53
+
54
+ ```console
55
+ rusky -h
56
+ Commands:
57
+ rusky help [COMMAND] # Describe available commands or one specific command
58
+ rusky install # Generate Git hooks and .rusky files
59
+ rusky uninstall # Remove files generated by rusky
60
+ rusky version # Show current version
61
+
62
+ Options:
63
+ -h, [--help], [--no-help] # Show help message.
64
+ -v, [--version], [--no-version] # Show current version
65
+ ```
66
+
50
67
  ### Customizable callback rake task
51
68
 
52
69
  You can write your own rake task as a callback of Git hook.
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rusky'
3
+
4
+ Rusky::CLI.start(ARGV)
@@ -1,4 +1,5 @@
1
1
  require 'rusky/version'
2
+ require 'rusky/cli'
2
3
  require 'yaml'
3
4
  require 'fileutils'
4
5
 
@@ -0,0 +1,24 @@
1
+ require 'rusky'
2
+ require 'thor'
3
+
4
+ module Rusky
5
+ class CLI < Thor
6
+ class_option :help, type: :boolean, aliases: '-h', desc: 'Show help message.'
7
+ class_option :version, type: :boolean, aliases: '-v', desc: 'Show current version'
8
+
9
+ desc "install", "Generate Git hooks and .rusky files"
10
+ def install
11
+ Rusky.install
12
+ end
13
+
14
+ desc "uninstall", "Remove files generated by rusky"
15
+ def uninstall
16
+ Rusky.uninstall
17
+ end
18
+
19
+ desc "version", "Show current version"
20
+ def version
21
+ puts Rusky::VERSION
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module Rusky
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.add_dependency "rake"
25
+ spec.add_dependency "thor"
25
26
 
26
27
  spec.add_development_dependency "bundler", "~> 1.15"
27
28
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rusky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masato Ohba
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-06 00:00:00.000000000 Z
11
+ date: 2017-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -69,7 +83,8 @@ dependencies:
69
83
  description: Rusky helps you to manage Git hooks easily.
70
84
  email:
71
85
  - over.rye@gmail.com
72
- executables: []
86
+ executables:
87
+ - rusky
73
88
  extensions: []
74
89
  extra_rdoc_files: []
75
90
  files:
@@ -82,8 +97,10 @@ files:
82
97
  - Rakefile
83
98
  - bin/console
84
99
  - bin/setup
100
+ - exe/rusky
85
101
  - lib/rubygems_plugin.rb
86
102
  - lib/rusky.rb
103
+ - lib/rusky/cli.rb
87
104
  - lib/rusky/task.rb
88
105
  - lib/rusky/version.rb
89
106
  - rusky.gemspec