dryrun 0.2.2 → 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: 023019aeabb2110eecf5faf785b16724eaa7609f
4
- data.tar.gz: 0ff9296f3fbb4d6a7df6af464949986814cf7588
3
+ metadata.gz: 08160975a123a709507d71e2d9e158fb850170c1
4
+ data.tar.gz: 5a15fbbfb0198799ceec7805b904d5f151225f7c
5
5
  SHA512:
6
- metadata.gz: 1887bb8914ff9cd18a06ac08b0fa908aa79dfde77358cc8936624ad50d904c2694a24f27bb6335f016c202bbc676d6c95c9da3c757d8a2eb6b4e86c30068637d
7
- data.tar.gz: b5cd854e0a02d2f80a2cfdbf5c3ae90a688216c1f0e3ee5c99cbccf8cca3f406ccba2bc7b8424117934d9757c1be9f0555846a758eccb7130ac1aa6c046bc01b
6
+ metadata.gz: 2819ea30a567820ce8dd12ca5f7e589cdaecf4dc8bdcef2e9a4e2d9a5ec24a1fc32704f9c84b80d46efcb1f9ad8c6098555013622832822943f4ed01274cb8a9
7
+ data.tar.gz: 18572c01b654d3148f51e0f527a43da97e18dc9bdc49357bc0ce464e3a31b80254bf76b5763cfd2ecbc6bcc62a5df1d813ffdebb24dbec1ca4963f6cfac232f8
data/.rspec ADDED
@@ -0,0 +1,5 @@
1
+ --require spec_helper
2
+ --tty
3
+ --color
4
+ --format documentation
5
+ --format html -o "tmp/rspec_result.html"
data/.travis.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 1.9.3
3
4
  - 2.2.1
4
- before_install: gem install bundler -v 1.10.6
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # dryrun
2
- [![Gem Version](https://badge.fury.io/rb/dryrun.svg)](http://badge.fury.io/rb/dryrun)
2
+ ![Header](https://travis-ci.org/cesarferreira/dryrun.svg?branch=master) [![Gem Version](https://badge.fury.io/rb/dryrun.svg)](http://badge.fury.io/rb/dryrun)
3
3
 
4
4
  **Try** an **android** library on your **smartphone** **directly** from the **command line**
5
5
 
data/Rakefile CHANGED
@@ -1 +1,11 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ require 'rspec/core/rake_task'
4
+
5
+ # Default directory to look in is `/specs`
6
+ # Run with `rake spec`
7
+ RSpec::Core::RakeTask.new(:spec) do |task|
8
+ task.rspec_opts = ['--color', '--format', 'nested']
9
+ end
10
+
11
+ task :default => :spec
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{try an android library directly from the command line}
18
- spec.description = %q{try an android library directly from the command line}
17
+ spec.summary = %q{Tool which allows to quickly try the demo project of an Android Library}
18
+ spec.description = %q{Tool which allows to quickly try the demo project of an Android Library}
19
19
  spec.homepage = "https://github.com/cesarferreira/dryrun"
20
20
 
21
21
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -26,6 +26,10 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "bundler", "~> 1.10"
27
27
  spec.add_development_dependency "rake", "~> 10.0"
28
28
  spec.add_development_dependency 'pry-byebug', '~> 3.1'
29
+ spec.add_development_dependency "rspec"
30
+ spec.add_development_dependency "rspec-nc"
31
+ spec.add_development_dependency "guard"
32
+ spec.add_development_dependency "guard-rspec"
29
33
 
30
34
  spec.add_dependency 'colorize', '~> 0.7'
31
35
  spec.add_dependency 'nokogiri', '~> 1.6.6.2'
data/lib/dryrun.rb CHANGED
@@ -41,8 +41,11 @@ module DryRun
41
41
  exit 1
42
42
  end
43
43
 
44
+ # clean and install the apk
44
45
  project.clean_install
45
46
 
47
+ puts "\n> If you want to remove the app you just installed, execute:\n#{project.get_uninstall_command.yellow}\n\n"
48
+
46
49
  end
47
50
  end
48
51
  end
@@ -51,7 +51,6 @@ module DryRun
51
51
 
52
52
  system("#{builder} clean assembleDebug installDebug")
53
53
 
54
-
55
54
  puts "Installing #{@package.green}...\n"
56
55
  puts "executing: #{execute_line}"
57
56
  system(execute_line)
@@ -64,19 +63,18 @@ module DryRun
64
63
  full_path = "#{@base_path}#{child.first}"
65
64
 
66
65
  execute_line = get_execute_line("#{full_path}/src/main/AndroidManifest.xml")
67
-
68
- if execute_line
69
- #puts "\nTHE SAMPLE IS HERE #{full_path.green}:\n"
70
- #system("tree #{full_path}")
71
- return full_path, execute_line
72
- end
66
+ return full_path, execute_line if execute_line
73
67
 
74
68
  end
75
69
  return false, false
76
70
  end
77
71
 
72
+ def get_uninstall_command
73
+ "adb uninstall #{@package}"
74
+ end
75
+
78
76
  def uninstall
79
- system("adb uninstall #{@package}")
77
+ system("#{self.get_uninstall_command} > /dev/null 2>&1")
80
78
  end
81
79
 
82
80
 
data/lib/dryrun/github.rb CHANGED
@@ -1,25 +1,20 @@
1
1
  require 'tmpdir'
2
2
  require 'fileutils'
3
3
  require 'uri'
4
- require 'colorize'
4
+ require 'pry'
5
5
 
6
6
  module DryRun
7
7
 
8
8
  class Github
9
9
  def initialize(url)
10
10
  @base_url = url
11
-
12
- begin
13
- @resource = URI.parse(url)
14
- rescue Exception => e
15
- puts "Invalid github url".red
16
- puts "Valid example: #{'https://github.com/cesarferreira/colorize'.green}"
17
- exit 1
18
- end
11
+ @destination = get_destination
19
12
  end
20
13
 
21
- def path
22
- @resource.path
14
+ def get_destination
15
+ destiny = @base_url.gsub('.git','')
16
+ destiny = destiny.split('/')
17
+ "#{destiny.last(2).join('/')}"
23
18
  end
24
19
 
25
20
  def is_valid
@@ -27,10 +22,21 @@ module DryRun
27
22
  end
28
23
 
29
24
  def clonable_url
30
- # if @base_url.split(//).last(4).join.eql? ".git" or @base_url.split(//).first(4).join.eql? "git@"
31
- # @base_url
32
- # else
33
- "#{@base_url}.git"
25
+ starts_with_git = @base_url.split(//).first(4).join.eql? "git@"
26
+ ends_with_git = @base_url.split(//).last(4).join.eql? ".git"
27
+
28
+ # ends with git but doesnt start with git
29
+ if ends_with_git and !starts_with_git
30
+ return @base_url
31
+ end
32
+
33
+ # ends with git but doesnt start with git
34
+ if !ends_with_git and !starts_with_git
35
+ return "#{@base_url}.git"
36
+ end
37
+
38
+ @base_url
39
+
34
40
  # end
35
41
  end
36
42
 
@@ -40,7 +46,7 @@ module DryRun
40
46
  def clone
41
47
  clonable = self.clonable_url
42
48
 
43
- tmpdir = Dir.tmpdir+"#{path}"
49
+ tmpdir = Dir.tmpdir+"dryrun/#{@destination}"
44
50
  FileUtils.rm_rf(tmpdir)
45
51
 
46
52
  system("git clone #{clonable} #{tmpdir}")
@@ -1,3 +1,3 @@
1
1
  module DryRun
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.1"
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.2.2
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - cesar ferreira
@@ -52,6 +52,62 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-nc
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard-rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
55
111
  - !ruby/object:Gem::Dependency
56
112
  name: colorize
57
113
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +136,7 @@ dependencies:
80
136
  - - "~>"
81
137
  - !ruby/object:Gem::Version
82
138
  version: 1.6.6.2
83
- description: try an android library directly from the command line
139
+ description: Tool which allows to quickly try the demo project of an Android Library
84
140
  email:
85
141
  - cesar.manuel.ferreira@gmail.com
86
142
  executables:
@@ -89,6 +145,7 @@ extensions: []
89
145
  extra_rdoc_files: []
90
146
  files:
91
147
  - ".gitignore"
148
+ - ".rspec"
92
149
  - ".travis.yml"
93
150
  - Gemfile
94
151
  - LICENSE
@@ -123,5 +180,5 @@ rubyforge_project:
123
180
  rubygems_version: 2.4.8
124
181
  signing_key:
125
182
  specification_version: 4
126
- summary: try an android library directly from the command line
183
+ summary: Tool which allows to quickly try the demo project of an Android Library
127
184
  test_files: []