snippy 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/snippy/cli.rb +6 -1
- data/lib/snippy/git.rb +27 -0
- data/lib/snippy/version.rb +1 -1
- data/snippy.gemspec +1 -0
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGFhNTEyOWRlYWI4YjBhM2ViZDU4NzFlNDVjMTkzYWVlNTMxOGU5Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGUzNjFkNDhjZWZlZmNjYTcyMzg1YzhmOWNkOTAyNzRhZGM2MGFlMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTljNzM3Mzg1ZTNkMzQ1NDE0MjY1Nzg4ODY5OTk0YzZiYTg0OGFhY2U0NjY2
|
10
|
+
MzNjMTVhNzBlOTQzZjQzMGIxMTc0NTg5ZTBiODU0ZjAxODQzMmExZDUyOWNj
|
11
|
+
NmZmNjJlYjRjYTEyYWQ0YzE2ZDhhNDIxODU2ZjE0NWMxNjRjZGM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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", "
|
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
|
data/lib/snippy/version.rb
CHANGED
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.
|
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
|