snippy 0.1.0 → 0.1.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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YjEwMTFjY2VkZTg0ZGZlNjEyNjM5ZmI1YWJjMzI3NzYxMWJmNDQ0MQ==
4
+ ZGFhNTEyOWRlYWI4YjBhM2ViZDU4NzFlNDVjMTkzYWVlNTMxOGU5Zg==
5
5
  data.tar.gz: !binary |-
6
- NjRhNjEwNGE2YWY5Yzc2ZDNlOWZkMDVlNzZmMGNiNTc5ZTA0MWRkNQ==
6
+ MGUzNjFkNDhjZWZlZmNjYTcyMzg1YzhmOWNkOTAyNzRhZGM2MGFlMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjE0OTdmMTNmZmEzZTMyMzcwNWJiZTA4MTZiOTk5NmI5ZGFjYzAzM2ZiOWYy
10
- MGYzOGY4MmM3ZTFlNDNlMjcxNWE4YTEyMmRjOTgxODFjZjIzNThlMzI3Yjcx
11
- NTgxNGJkNGYzNzU0N2U5ZmY5MTdmNzFiNzE2ZDI1NmM0NGQwYjM=
9
+ NTljNzM3Mzg1ZTNkMzQ1NDE0MjY1Nzg4ODY5OTk0YzZiYTg0OGFhY2U0NjY2
10
+ MzNjMTVhNzBlOTQzZjQzMGIxMTc0NTg5ZTBiODU0ZjAxODQzMmExZDUyOWNj
11
+ NmZmNjJlYjRjYTEyYWQ0YzE2ZDhhNDIxODU2ZjE0NWMxNjRjZGM=
12
12
  data.tar.gz: !binary |-
13
- OTc0MWM5NGY1ZDk2ODk5MzE2NDlmNTdmZTZlMTdjZjc4OWY3ZGIwYjllMmJh
14
- NTRhMmQ3NGMyYjY3M2NjOWQ0NTEwOWRkODJlZDY0MzRiYzk3Y2QxNGI0YjUz
15
- NTU5MWI4N2NkYmU4NWZjMmZkYTc0M2NmZjI4ZmM1ZjcxY2RjMzM=
13
+ ODVmYzBiODRkZjJiOTk4MDM4Mjk3NjRhMjU3OThlN2E4YTk1OTczOTZjODA4
14
+ NzZjYmRjZWFjYzJjYWY3M2U3MzBjNjMyZjdiNzk4YzM1ZWU4ZDNlMWVmMzU3
15
+ NTkwMjg5MmMwZDMyOWM5MDQwZDE2YmUxOGYxYTM4OThmZWU2Mjk=
data/lib/snippy/cli.rb CHANGED
@@ -1,11 +1,16 @@
1
1
  require "thor"
2
+ require "snippy/git"
2
3
  require "snippy/apache"
3
4
 
4
5
  module Snippy
5
6
  class Cli < Thor
6
7
  class_option :verbose, :type => :boolean
7
8
 
8
- desc "apache SUBCOMMAND ...ARGS", "Snippets & Tools for apache"
9
+ desc "apache SUBCOMMAND ...ARGS", "Apache shortcuts and helper."
9
10
  subcommand "apache", Apache
11
+
12
+ desc "git SUBCOMMAND ...ARGS", "Git shortcuts and helper."
13
+ subcommand "git", Git
14
+
10
15
  end
11
16
  end
data/lib/snippy/git.rb ADDED
@@ -0,0 +1,27 @@
1
+ require "git"
2
+ require "thor"
3
+
4
+ module Snippy
5
+ class Git < Thor
6
+
7
+ desc "retag", "Redo the lastest git tag."
8
+ method_option :push, :type => :boolean, :default => true, :aliases => "-p"
9
+ def retag
10
+ raise Thor::Error, "Not a git repository!" unless Dir.exists?(".git")
11
+ g = ::Git.open(".")
12
+ tags = g.tags
13
+ raise Thor::Error, "No tag found!" if tags.empty?
14
+ tag = tags.pop.name
15
+ puts "Deleting tag: #{tag}"
16
+ system "git tag -d #{tag}"
17
+ puts "Creating tag: #{tag}"
18
+ g.add_tag(tag)
19
+ if options[:push]
20
+ raise Thor::Error, "No remote!" if g.branches.remote.empty?
21
+ puts "Pushing files"
22
+ g.push
23
+ end
24
+ end
25
+
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module Snippy
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/snippy.gemspec CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
+ spec.add_runtime_dependency "git"
21
22
  spec.add_runtime_dependency "thor"
22
23
 
23
24
  spec.add_development_dependency "bundler", "~> 1.3"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snippy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - franklin
@@ -10,6 +10,20 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2013-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: git
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: thor
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -69,6 +83,7 @@ files:
69
83
  - lib/snippy.rb
70
84
  - lib/snippy/apache.rb
71
85
  - lib/snippy/cli.rb
86
+ - lib/snippy/git.rb
72
87
  - lib/snippy/version.rb
73
88
  - snippy.gemspec
74
89
  homepage: http://rubygems.org/gems/snippy