dryrun 0.5.3 → 0.5.4
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 +4 -4
- data/README.md +1 -0
- data/dryrun.gemspec +2 -2
- data/lib/dryrun.rb +30 -5
- data/lib/dryrun/android_project.rb +11 -5
- data/lib/dryrun/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 174c7236a0957be8594263e4e483217c54475d83
|
|
4
|
+
data.tar.gz: e55002d02f960d4bcea80bba85c03c0d4d20e202
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6cd9cea5debb93d6d77993334243c5b5ec12525ad08518a2448c1fe03e9068c7fdba96f704396d37d50d41b145dd68160ce0a78437b3b6ab582ccc5bae14db94
|
|
7
|
+
data.tar.gz: 014ab1495419fe5511d282ca74aeb12c8f3ad2e7ffeb3045dd3e897b145c3c47b18c4fd7e5307d1b44e34fd27e887bf50deeef46786c7758dfc0b37d7488a81c
|
data/README.md
CHANGED
|
@@ -23,6 +23,7 @@ Usage: dryrun GITHUB_URL [OPTIONS]
|
|
|
23
23
|
|
|
24
24
|
Options
|
|
25
25
|
-m, --module MODULE_NAME Custom module to run
|
|
26
|
+
-f, --flavour FLAVOUR Specifies the flavour (e.g. dev, qa, prod)
|
|
26
27
|
-p, --path PATH Custom path to android project
|
|
27
28
|
-h, --help Displays help
|
|
28
29
|
-v, --version Displays version
|
data/dryrun.gemspec
CHANGED
|
@@ -14,8 +14,8 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
spec.authors = ["cesar ferreira"]
|
|
15
15
|
spec.email = ["cesar.manuel.ferreira@gmail.com"]
|
|
16
16
|
|
|
17
|
-
spec.summary = %q{Tool
|
|
18
|
-
spec.description = %q{Tool
|
|
17
|
+
spec.summary = %q{Tool to try any android library hosted online directly from the command line}
|
|
18
|
+
spec.description = %q{Tool to try any android library hosted online directly from the command line}
|
|
19
19
|
spec.homepage = "https://github.com/cesarferreira/dryrun"
|
|
20
20
|
spec.license = 'MIT'
|
|
21
21
|
|
data/lib/dryrun.rb
CHANGED
|
@@ -5,24 +5,39 @@ require 'fileutils'
|
|
|
5
5
|
require 'dryrun/github'
|
|
6
6
|
require 'dryrun/version'
|
|
7
7
|
require 'dryrun/android_project'
|
|
8
|
+
require 'pry'
|
|
8
9
|
|
|
9
10
|
module DryRun
|
|
10
11
|
class MainApp
|
|
11
12
|
def initialize(arguments)
|
|
12
|
-
|
|
13
|
+
|
|
13
14
|
@url = ['-h', '--help', '-v', '--version'].include?(arguments.first) ? nil : arguments.shift
|
|
15
|
+
|
|
16
|
+
# defaults
|
|
14
17
|
@app_path = nil
|
|
15
18
|
@custom_module = nil
|
|
16
|
-
@
|
|
19
|
+
@flavour = ''
|
|
20
|
+
|
|
21
|
+
# Parse Options
|
|
22
|
+
# arguments.push "-h" if arguments.length == 0
|
|
17
23
|
|
|
18
24
|
unless @url
|
|
19
25
|
puts @opt_parser.help
|
|
20
26
|
exit
|
|
21
27
|
end
|
|
28
|
+
|
|
29
|
+
create_options_parser(arguments)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# @opt_parser.parse!(arguments)
|
|
33
|
+
|
|
34
|
+
# create_options_parser
|
|
35
|
+
|
|
36
|
+
|
|
22
37
|
end
|
|
23
38
|
|
|
24
|
-
def create_options_parser
|
|
25
|
-
|
|
39
|
+
def create_options_parser(args)
|
|
40
|
+
args.options do |opts|
|
|
26
41
|
opts.banner = "Usage: dryrun GITHUB_URL [OPTIONS]"
|
|
27
42
|
opts.separator ''
|
|
28
43
|
opts.separator "Options"
|
|
@@ -30,17 +45,27 @@ module DryRun
|
|
|
30
45
|
opts.on('-m MODULE_NAME', '--module MODULE_NAME', 'Custom module to run') do |custom_module|
|
|
31
46
|
@custom_module = custom_module
|
|
32
47
|
end
|
|
48
|
+
|
|
49
|
+
opts.on('-f', '--flavour FLAVOUR', 'Specifies the flavour (e.g. dev, qa, prod)') do |flavour|
|
|
50
|
+
@flavour = flavour.capitalize
|
|
51
|
+
puts "im on the flavour: #{@flavour}"
|
|
52
|
+
end
|
|
53
|
+
|
|
33
54
|
opts.on('-p PATH', '--path PATH', 'Custom path to android project') do |app_path|
|
|
34
55
|
@app_path = app_path
|
|
35
56
|
end
|
|
57
|
+
|
|
36
58
|
opts.on('-h', '--help', 'Displays help') do
|
|
37
59
|
puts opts.help
|
|
38
60
|
exit
|
|
39
61
|
end
|
|
62
|
+
|
|
40
63
|
opts.on('-v', '--version', 'Displays version') do
|
|
41
64
|
puts DryRun::VERSION
|
|
42
65
|
exit
|
|
43
66
|
end
|
|
67
|
+
opts.parse!
|
|
68
|
+
|
|
44
69
|
end
|
|
45
70
|
end
|
|
46
71
|
|
|
@@ -67,7 +92,7 @@ module DryRun
|
|
|
67
92
|
# clone the repository
|
|
68
93
|
repository_path = github.clone
|
|
69
94
|
|
|
70
|
-
android_project = AndroidProject.new(repository_path, @app_path, @custom_module)
|
|
95
|
+
android_project = AndroidProject.new(repository_path, @app_path, @custom_module, @flavour)
|
|
71
96
|
|
|
72
97
|
# is a valid android project?
|
|
73
98
|
unless android_project.is_valid
|
|
@@ -2,13 +2,16 @@ require 'oga'
|
|
|
2
2
|
require 'fileutils'
|
|
3
3
|
require 'tempfile'
|
|
4
4
|
require_relative 'dryrun_utils'
|
|
5
|
+
require 'pry'
|
|
5
6
|
|
|
6
7
|
module DryRun
|
|
7
8
|
class AndroidProject
|
|
8
|
-
def initialize(path, custom_app_path, custom_module)
|
|
9
|
+
def initialize(path, custom_app_path, custom_module, flavour)
|
|
10
|
+
|
|
9
11
|
@custom_app_path = custom_app_path
|
|
10
12
|
@custom_module = custom_module
|
|
11
13
|
@base_path = path
|
|
14
|
+
@flavour = flavour
|
|
12
15
|
@settings_gradle_path = settings_gradle_file
|
|
13
16
|
|
|
14
17
|
check_custom_app_path
|
|
@@ -81,7 +84,7 @@ module DryRun
|
|
|
81
84
|
if File.exist?('gradlew')
|
|
82
85
|
DryrunUtils.execute('chmod +x gradlew')
|
|
83
86
|
|
|
84
|
-
builder = '
|
|
87
|
+
builder = './gradlew'
|
|
85
88
|
end
|
|
86
89
|
|
|
87
90
|
# Generate the gradle/ folder
|
|
@@ -91,9 +94,12 @@ module DryRun
|
|
|
91
94
|
remove_local_properties
|
|
92
95
|
|
|
93
96
|
if @custom_module
|
|
94
|
-
DryrunUtils.execute("#{builder} clean
|
|
97
|
+
DryrunUtils.execute("#{builder} clean")
|
|
98
|
+
DryrunUtils.execute("#{builder} :#{@custom_module}:install#{@flavour}Debug")
|
|
95
99
|
else
|
|
96
|
-
DryrunUtils.execute("#{builder} clean
|
|
100
|
+
DryrunUtils.execute("#{builder} clean")
|
|
101
|
+
puts "#{builder} install#{@flavour}Debug"
|
|
102
|
+
DryrunUtils.execute("#{builder} install#{@flavour}Debug")
|
|
97
103
|
end
|
|
98
104
|
|
|
99
105
|
clear_app_data
|
|
@@ -136,7 +142,7 @@ module DryRun
|
|
|
136
142
|
end
|
|
137
143
|
|
|
138
144
|
def clear_app_data
|
|
139
|
-
|
|
145
|
+
system(get_clear_app_command)
|
|
140
146
|
end
|
|
141
147
|
|
|
142
148
|
def uninstall_application
|
data/lib/dryrun/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dryrun
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- cesar ferreira
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-03-
|
|
11
|
+
date: 2016-03-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -94,7 +94,8 @@ dependencies:
|
|
|
94
94
|
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: 1.3.1
|
|
97
|
-
description: Tool
|
|
97
|
+
description: Tool to try any android library hosted online directly from the command
|
|
98
|
+
line
|
|
98
99
|
email:
|
|
99
100
|
- cesar.manuel.ferreira@gmail.com
|
|
100
101
|
executables:
|
|
@@ -145,5 +146,5 @@ rubyforge_project:
|
|
|
145
146
|
rubygems_version: 2.4.5.1
|
|
146
147
|
signing_key:
|
|
147
148
|
specification_version: 4
|
|
148
|
-
summary: Tool
|
|
149
|
+
summary: Tool to try any android library hosted online directly from the command line
|
|
149
150
|
test_files: []
|