newclear 0.7 → 1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c7fd421d5dec7847d04b26a0f74ee61fa790144
4
- data.tar.gz: bf9f2d15cd074747ec5742d6188a7a382a8096cb
3
+ metadata.gz: 5360373b47b8b7e37292a311e0eb6c867eb0fc13
4
+ data.tar.gz: 3e04c27c9e2a051cf6d070186552108c059b8de1
5
5
  SHA512:
6
- metadata.gz: d69796a58eeb3cec5aded3cfa4d49d04f9a18bdd26d813e9a1f0923958efb2de9758567cd6486ae23eee35ac6b28309eda85fd2ab94e75a09a188f6477d5170a
7
- data.tar.gz: fc6835a69913dab0da8458652cae790647df0869310622925952a84abad38cab553b9170ad4dc25d6323075489b8a54f1da804efa04f185efb08e50c442ac73c
6
+ metadata.gz: 233df04279cfb836eb6b98476772f2cff882e0945a5761e346944e3e2c1274850fe1b9acf110737d55c86b48c6cf621e68e01c0654650f3af35073da1b08abe6
7
+ data.tar.gz: 19efc84206438eec7fcf3b9dadbc2539d5848dcfafcb6bcb50d2c71b2ddb49ebabbd696d67ee1358050469d610ee02e11b74ef61cb68a5a3eb5c0c5ee26ecd0a
data/README.md CHANGED
@@ -2,28 +2,30 @@
2
2
 
3
3
  **newclear gem** - Your one line and relax solution to a ground up rebuild of your iOS or Android RubyMotion app.
4
4
 
5
- ## Usage
5
+ ## Why?
6
+ Sometimes a build gets _FUBAR_. When you run `rake newclear` it builds your project from the ground up without you having to interact at each step in the rebuild process. _Just type and chillax._
6
7
 
7
- ### Run either of these lovely commands and then take a _LONG_ walk.
8
+ ## Usage
9
+ **newclear** comes with 3 helpful rake tasks.
8
10
 
9
11
  #### nuke
10
12
  `[bundle exec] rake nuke`
11
13
 
12
- `nuke` clears everything. Which actually just runs the following commands:
13
-
14
- ```
15
- rake clean:all
16
- reset-sim #if you're on an iOS project
17
- bundle install
18
- pod setup && rake pod:install # if you're using motion-cocoapods
19
- rake gradle:install # if you're using motion-gradle
20
- ```
14
+ `nuke` clears everything from previous builds and fetches fresh resources in the correct order. This is excellent for tests.
21
15
 
22
16
  #### newclear
23
17
  `[bundle exec] rake newclear`
24
18
 
25
- `newclear` gives you a new and clear run of your build. This runs `nuke` and then `rake` (`rake device` for android).
19
+ `newclear` gives you a new and clear run of your build. This runs `nuke` and then `rake` (`rake device` for android if you have no emulator running). This is great for kicking off the rebuild to clear any cruft that might be crashing your app.
20
+
21
+ #### newclear:debug
22
+ `[bundle exec] rake newclear:debug`
23
+
24
+ `newclear:debug` gives you the detected parameters of your setup. If you have _any_ complication with newclear, be sure to use this to makes sure newclear is detecing your system setup correctly.
26
25
 
26
+ #### How does it work?
27
+ If you want to trace the logic, here's what the command does:
28
+ ![newclear logic tree](./_art/newclear_flow_chart.png)
27
29
 
28
30
  ## Install
29
31
 
@@ -48,4 +50,5 @@ We're using Rickert's lovely `reset-sim` gem in our nuke. So be sure to have a
48
50
  2. Create your feature branch (`git checkout -b my-new-feature`)
49
51
  3. Commit your changes (`git commit -am 'Add some feature'`)
50
52
  4. Push to the branch (`git push origin my-new-feature`)
51
- 5. Create new Pull Request
53
+ 5. Hula hoop and down a beer in under a minute.
54
+ 6. Create new Pull Request
@@ -22,4 +22,14 @@ task :newclear do
22
22
  build_project
23
23
  end
24
24
 
25
+ namespace :newclear do
26
+ desc "Print out newclear detected settings"
27
+ task :debug do
28
+ puts "If any of these are off, newclearr will not work correctly"
29
+ puts "***" * 20
30
+ puts "Is Android? = #{is_android?}"
31
+ puts "Running Genymotion? = #{running_genymotion?}"
32
+ puts "***" * 20
33
+ end
34
+ end
25
35
 
@@ -2,14 +2,14 @@ module NewclearHelper
2
2
 
3
3
  NUKE_MESSAGE = <<-eos
4
4
  *********************************
5
- N U K E COMPLETE
5
+ N U K E COMPLETE
6
6
  *********************************
7
7
  eos
8
-
8
+
9
9
  def nuke_project
10
10
  puts "\nCleaning Project..."
11
11
  `rake clean:all`
12
-
12
+
13
13
  unless is_android?
14
14
  puts "\nResetting simulator..."
15
15
  `reset-sim`
@@ -17,7 +17,7 @@ module NewclearHelper
17
17
 
18
18
  puts "\nBundling..."
19
19
  `bundle install`
20
-
20
+
21
21
  # iOS Depencies
22
22
  if has_task? "pod:install"
23
23
  puts "\nSetting up cocoapods..."
@@ -35,7 +35,8 @@ module NewclearHelper
35
35
 
36
36
  def build_project
37
37
  puts "Building project..."
38
- if is_android?
38
+ if is_android? and !running_genymotion?
39
+ puts "for device"
39
40
  `rake device`
40
41
  else
41
42
  `rake`
@@ -49,4 +50,20 @@ module NewclearHelper
49
50
  def is_android?
50
51
  @android ||= system("rake -T | grep -q .apk")
51
52
  end
53
+
54
+ # We assume they keep their API in the emulator name
55
+ def running_genymotion?
56
+ genymotion_active = false
57
+ if system("which VBoxManage > /dev/null")
58
+ running_vms = `VboxManage list runningvms`
59
+ vm_ids = running_vms.scan(/({[^}]+})\n/).flatten # get all VM IDs
60
+ # check all to see if any are Genymotion VMs
61
+ vm_ids.each do |vm_id|
62
+ genymotion_active = true if system("VBoxManage showvminfo #{vm_id} | grep -q Genymotion")
63
+ end
64
+ end
65
+
66
+ # Return our findings
67
+ genymotion_active
68
+ end
52
69
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newclear
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.7'
4
+ version: '1.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gant
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-14 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reset-sim