lasertag 0.3.0 → 0.3.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
  SHA1:
3
- metadata.gz: 9426e016e328362a09deadd681d53319d2ad8a6e
4
- data.tar.gz: c6035f6b106dee761e40e24f891314e1d2c8c46b
3
+ metadata.gz: 04084b2ac6f3c0611e281a61b69aa8b161dde091
4
+ data.tar.gz: 7b29b46562469fd1ad3a6f342d814a3916773c90
5
5
  SHA512:
6
- metadata.gz: a8823d5eec834807eb5e451acb0cf40cf290e136f5723ecfbe8ffd7e5642bd2238d0880e8d69f2c21c192af2a93981d265b9518e119ae2beea53a6ea7612b628
7
- data.tar.gz: 0380b6e3b4a54ebd027970b71629a18643870373861a69d94c5eb4d65ca9a416ef941258e8f2e843c83dc0004ae87dfc1f28412fbe626db060f4f0bc558aa051
6
+ metadata.gz: a4293c7cd83e03fa48a9c6475b87e75d36b7097c1bd4a07ad13de54d898757cf34899e1524d123ba9332a56a8b60043e094127e509fc888dd3a1d71c69876e7d
7
+ data.tar.gz: b643a7e2a885a6a5ef4c6dbf9a84ae9ff6b9aeeaa69b58c674d0b4c23a3f26c86c4b333b2bca54f6705be5c8d04b077ec01cca2997a17f505e70f3514edd3704
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <!-- Match your CVS tags with your android versions with laser speed! -->
7
7
 
8
8
  <p align="center">
9
- <img src="https://raw.githubusercontent.com/cesarferreira/lasertag/master/extras/terminal.gif" width="100%" />
9
+ <img src="extras/terminal.gif" />
10
10
  </p>
11
11
 
12
12
 
@@ -14,11 +14,24 @@
14
14
 
15
15
  $ lasertag --module [module_name]
16
16
 
17
- #### Going deeper
17
+ This will extract the android's app module `version` and create a matching `git tag`.
18
+ Pretty helpful in situations like my personal choice of git workflow, the [Gitflow Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow), a strict branching model designed around the project release:
18
19
 
19
- If you want to specify a flavor:
20
+ <p align="center">
21
+ <img src="extras/gitflow.png" />
22
+ </p>
23
+
24
+ #### Help
25
+
26
+ Usage: lasertag [OPTIONS]
20
27
 
21
- $ lasertag --module app --flavor prod
28
+ Options
29
+ -m, --module MODULE # Specifies the app module
30
+ -f, --flavor FLAVOR # Specifies the flavor (e.g. dev, qa, prod)
31
+ -p, --path PATH # Custom path to android project
32
+ -r, --remote REMOTE # Custom remote to your project (default: "origin")
33
+ -h, --help # Displays help
34
+ -v, --version # Displays version
22
35
 
23
36
 
24
37
  ## Installation
@@ -32,6 +45,7 @@ If you want to specify a flavor:
32
45
  - executes git tag -a v[tag_version] -m "tag [tag_name]"
33
46
  - executes git push origin [tag_name]
34
47
 
48
+ when a step fails, it stops the whole process.
35
49
 
36
50
  ## License
37
51
 
Binary file
@@ -1,3 +1,3 @@
1
1
  module Lasertag
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/lib/lasertag.rb CHANGED
@@ -12,6 +12,7 @@ module Lasertag
12
12
  @app_path = Dir.pwd
13
13
  @app_module = nil
14
14
  @app_flavor = nil
15
+ @app_remote = 'origin'
15
16
 
16
17
  @require_analyses = true
17
18
 
@@ -42,6 +43,10 @@ module Lasertag
42
43
  @app_path = app_path if @app_path != '.'
43
44
  end
44
45
 
46
+ opts.on('-r REMOTE', '--remote REMOTE', 'Custom remote to your project (default: "origin")') do |app_remote|
47
+ @app_remote = app_remote
48
+ end
49
+
45
50
  opts.on('-h', '--help', 'Displays help') do
46
51
  @require_analyses = false
47
52
  puts opts.help
@@ -139,16 +144,22 @@ module Lasertag
139
144
  end
140
145
 
141
146
  ### PUSH TAG
142
- def push_tag(version)
147
+ def push_tag(tag)
143
148
  g = Git.open(Dir.pwd)
144
149
  begin
145
- g.push(g.remote('origin'), version)
150
+ g.push(g.remote(@app_remote), tag)
146
151
  rescue Exception => e
147
152
  puts "Can't push tag\n reason: #{e.to_s.red}"
153
+ delete_tag tag
148
154
  exit 1
149
155
  end
150
156
  end
151
157
 
158
+ ### DELETE TAG
159
+ def delete_tag(tag)
160
+ g = Git.open(Dir.pwd)
161
+ g.delete_tag(tag)
162
+ end
152
163
 
153
164
  ### TAG CODE
154
165
  def tag_code(version)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lasertag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - cesarferreira
@@ -124,6 +124,7 @@ files:
124
124
  - README.md
125
125
  - Rakefile
126
126
  - bin/lasertag
127
+ - extras/gitflow.png
127
128
  - extras/terminal.gif
128
129
  - lasertag.gemspec
129
130
  - lib/lasertag.rb