newclear 0.5 → 0.6

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: ab36adea4563c111f94d0149344e971fcc41a706
4
- data.tar.gz: ee5094f17caef4a717191a27aa3a674a2dc66b15
3
+ metadata.gz: a54eac1de2140ec44532333a327aa7515b7e0f0d
4
+ data.tar.gz: e1f8b351efa4bf1f20ead759afbe6b59bde2e828
5
5
  SHA512:
6
- metadata.gz: 0d31dfa6f430841d68e476d9c0ba6a90b90bbcaea9d46a373a5b8904f99a13aec40850eb34cd14fcbbd53b2cf962d47520bebc3f6f80e833a1236526cf7fc0d5
7
- data.tar.gz: 3ad104b27d06a44bc110cb1ece9b97f5191aa5f1b78531315f7155cc7df355781d77814e3bb1908010b1843957e7136067aec03a73e2ce2c55391389373d8d31
6
+ metadata.gz: d8858492966dcbb2427e8b6793f25f0be32db15d0e1f52a461e1844a5abf182b7b19f26f42651ab2f51a057af7ac77c8e8b94b127bb4ae05a2a9894a144d0017
7
+ data.tar.gz: c6c40376ff4ee1fce469dbc30369c948a37f9f33d9d9cde43503e919a1f55a007f87d5768f268f3194220a351051f1c9997d5b1a52d38e2dd28bacbad4257873
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![newclear gem logo](http://i.imgur.com/9zP1VGD.png)
2
2
 
3
- **newclear gem** - Your one line and walk solution to a ground up rebuild.
3
+ **newclear gem** - Your one line and relax solution to a ground up rebuild of your iOS or Android RubyMotion app.
4
4
 
5
5
  ## Usage
6
6
 
@@ -9,12 +9,20 @@
9
9
  #### nuke
10
10
  `[bundle exec] rake nuke`
11
11
 
12
- `nuke` clears everything. Which actually just runs `rake clean:all && reset-sim && bundle && pod setup && rake pod:install`
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
+ ```
13
21
 
14
22
  #### newclear
15
23
  `[bundle exec] rake newclear`
16
24
 
17
- `newclear` gives you a new and clear run of your build. This runs `nuke` and then `rake`.
25
+ `newclear` gives you a new and clear run of your build. This runs `nuke` and then `rake` (`rake device` for android).
18
26
 
19
27
 
20
28
  ## Install
@@ -1,27 +1,25 @@
1
1
  # encoding: utf-8
2
-
3
2
  unless defined?(Motion::Project::Config)
4
3
  raise "This file must be required within a RubyMotion project Rakefile."
5
4
  end
6
5
 
6
+ # Bring in functionality
7
+ require_relative "newclear_helper"
8
+ include NewclearHelper
9
+
7
10
 
8
11
  desc "Completely resets everything for your project"
9
12
  task :nuke do
10
- puts "\nCleaning Project..."
11
- `rake clean:all`
12
- puts "\nResetting simulator..."
13
- `reset-sim`
14
- puts "\nBundling..."
15
- `bundle`
16
- puts "\nSetting up cocoapods..."
17
- `pod setup`
18
- puts "\nInstalling cocoapod dependencies..."
19
- `rake pod:install`
13
+ nuke_project
14
+ puts NewclearHelper::NUKE_MESSAGE
20
15
  end
21
16
 
22
17
  desc "Completely reset everything in project and run"
23
18
  task :newclear do
24
- Rake::Task["nuke"].execute
25
- puts "Building project..."
26
- `rake`
19
+ # out with the old
20
+ nuke_project
21
+ # in with the new
22
+ build_project
27
23
  end
24
+
25
+
@@ -0,0 +1,52 @@
1
+ module NewclearHelper
2
+
3
+ NUKE_MESSAGE = <<-eos
4
+ *********************************
5
+ N U K E COMPLETE
6
+ *********************************
7
+ eos
8
+
9
+ def nuke_project
10
+ puts "\nCleaning Project..."
11
+ `rake clean:all`
12
+
13
+ unless is_android?
14
+ puts "\nResetting simulator..."
15
+ `reset-sim`
16
+ end
17
+
18
+ puts "\nBundling..."
19
+ `bundle install`
20
+
21
+ # iOS Depencies
22
+ if has_task? "pod:install"
23
+ puts "\nSetting up cocoapods..."
24
+ `pod setup`
25
+ puts "\nInstalling cocoapod dependencies..."
26
+ `rake pod:install`
27
+ end
28
+
29
+ # Android Dependencies
30
+ if has_task? "gradle:install"
31
+ puts "\nSetting up gradle automation dependencies..."
32
+ `rake gradle:install`
33
+ end
34
+ end
35
+
36
+ def build_project
37
+ puts "Building project..."
38
+ if is_android?
39
+ `rake device`
40
+ else
41
+ `rake`
42
+ end
43
+ end
44
+
45
+ def has_task?(task_name)
46
+ Rake.application.tasks.count{ |rt| rt.name == "task_name"} > 0
47
+ end
48
+
49
+ def is_android?
50
+ @android ||= system("rake -T | grep -q .apk")
51
+ end
52
+ 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.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gant
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-22 00:00:00.000000000 Z
11
+ date: 2015-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reset-sim
@@ -48,9 +48,10 @@ extra_rdoc_files: []
48
48
  files:
49
49
  - README.md
50
50
  - lib/newclear.rb
51
- homepage: ''
51
+ - lib/newclear_helper.rb
52
+ homepage: https://github.com/IconoclastLabs/newclear
52
53
  licenses:
53
- - ''
54
+ - MIT
54
55
  metadata: {}
55
56
  post_install_message:
56
57
  rdoc_options: []
@@ -71,5 +72,5 @@ rubyforge_project:
71
72
  rubygems_version: 2.4.5
72
73
  signing_key:
73
74
  specification_version: 4
74
- summary: rake task to rebuild entire rubymotion project
75
+ summary: rake task to rebuild entire rubymotion project from scratch.
75
76
  test_files: []