dryrun 0.5.7 → 0.5.8

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: 3bf2583a4eb91ffe822b62c53228541ae74c578c
4
- data.tar.gz: 1cb504c8a1be9c27e221650d3127c5ecbcaa2c36
3
+ metadata.gz: 103e1c06ee696ecdb3da241e0dcb406edc6cc38b
4
+ data.tar.gz: d370ecbb990cc9eb5f1b4b6325ecdc950b57fadc
5
5
  SHA512:
6
- metadata.gz: 423c7eb608aec7c7ff3fc38c86ff1d88214e3f2c6bdc99b7f403ce8a47770f1c4537acf63cca891406a6430ed3644a8e0b51e4e99d25b847c6b73b0ed3d738f0
7
- data.tar.gz: b736cc9d989da85da18aa81696ccfa8dc965f7c426673e95d0d0b1aedff6af0af226a252f8b2b1789f72034268be6711a0cd933bfcb3841b50254dc2c93813e4
6
+ metadata.gz: 90ed2eb595844cfea635adaf7fb6ddf65b5f51cf8cd158d55eb727f53cfe7c630f838672a043a832f15cfd5f63deb7f849fc583a4b12836d9fe55f413e124cfa
7
+ data.tar.gz: 344a4380aa0f371669835580f3e28a0868e768b7e906309ec5b881ccf2171e4e60cf7d019f4bfaf45e3724ae04509db30c0b925974bf91a3879c5b00979b8832
data/README.md CHANGED
@@ -3,10 +3,8 @@
3
3
 
4
4
  **Try** any **android library** hosted online **directly** from the **command line**
5
5
 
6
- > A dry run is a testing process where the effects of a possible failure are intentionally mitigated. For example, an aerospace company may conduct a "dry run" test of a jet's new pilot ejection seat while the jet is parked on the ground, rather than while it is in flight.
7
-
8
6
  <p align="center">
9
- <img src="https://raw.githubusercontent.com/cesarferreira/dryrun/master/extras/usage_v2.gif" width="100%" />
7
+ <img src="https://raw.githubusercontent.com/cesarferreira/dryrun/master/extras/usage_v3.gif" width="100%" />
10
8
  </p>
11
9
 
12
10
  ## Usage
@@ -25,7 +23,7 @@ Options
25
23
  -m, --module MODULE_NAME Custom module to run
26
24
  -f, --flavour FLAVOUR Specifies the flavour (e.g. dev, qa, prod)
27
25
  -p, --path PATH Custom path to android project
28
- -t, --tag TAG Specifies a custom tag to clone (e.g. "v0.4.5", "6f7dd4b")
26
+ -t, --tag TAG Specifies a custom tag/commit hash to clone (e.g. "v0.4.5", "6f7dd4b")
29
27
  -h, --help Displays help
30
28
  -v, --version Displays version
31
29
  ```
data/lib/dryrun.rb CHANGED
@@ -97,7 +97,7 @@ module DryRun
97
97
  # clean and install the apk
98
98
  android_project.install
99
99
 
100
- puts "\n> If you want to remove the app you just installed, execute:\n#{android_project.get_uninstall_command.yellow}\n\n"
100
+ puts "\n> If you want to remove the app you just installed, execute:\n#{android_project.get_uninstall_command.red}\n\n"
101
101
  end
102
102
  end
103
103
  end
data/lib/dryrun/github.rb CHANGED
@@ -50,13 +50,28 @@ module DryRun
50
50
  clonable = self.clonable_url
51
51
 
52
52
  tmpdir = Dir.tmpdir+"/dryrun/#{@destination}"
53
- FileUtils.rm_rf(tmpdir)
54
-
55
- DryrunUtils.execute("git clone #{clonable} #{tmpdir}")
53
+ folder_exists = File.directory?(tmpdir)
54
+
55
+ if folder_exists
56
+ Dir.chdir tmpdir
57
+ is_git_repo = system("git rev-parse")
58
+
59
+ if !is_git_repo
60
+ FileUtils.rm_rf(tmpdir)
61
+ DryrunUtils.execute("git clone #{clonable} #{tmpdir}")
62
+ else
63
+ DryrunUtils.execute("git reset --hard HEAD")
64
+ DryrunUtils.execute("git checkout master")
65
+ DryrunUtils.execute("git pull origin master")
66
+ end
67
+
68
+ else
69
+ DryrunUtils.execute("git clone #{clonable} #{tmpdir}")
70
+ end
56
71
 
57
72
  if tag
58
73
  Dir.chdir tmpdir
59
- DryrunUtils.execute("git checkout #{tag} -b #{tag}")
74
+ DryrunUtils.execute("git checkout #{tag}")
60
75
  end
61
76
 
62
77
  tmpdir
@@ -1,3 +1,3 @@
1
1
  module DryRun
2
- VERSION = '0.5.7'
2
+ VERSION = '0.5.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dryrun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - cesar ferreira