cordova-rake 0.3.1 → 0.4.3

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: bc6ff3ee63d57ab2b07772ac53132ffd984a4f5b
4
- data.tar.gz: df4a9671787ad22d90fabb2200a0ad7f1673334e
3
+ metadata.gz: f9aab2bf1ee1f37dd51d019893e17420fe161970
4
+ data.tar.gz: fcedac6d2d0286f30c41bd2674eb8ff3d3313ad7
5
5
  SHA512:
6
- metadata.gz: 8c97d00dd0f815651b6fd14cd6fd5ae53423e7f44ec3ab56d675285fed5ae9c886f0389f9da1e1942c7f8f947ce536353a05e219aaa158513d9f60abf02bd20f
7
- data.tar.gz: fdc9f62371c8e6eca8585cceeaaa519eee530676c38d5a986f04b88bec2b1df435c9e696464e9577b082f4d802ad53f892f601ecf02884eea7664cfa40efd3a7
6
+ metadata.gz: e13a5195f7f02b6cd40f01007337115e04526d3376efbc0c918a2e40523c630f9bca22c0009c282aac8123ce0536dcb22aed81f1ba366c32969286222def911c
7
+ data.tar.gz: 836915e56626832735c0b80b59a878adc9523f415fd0885164c280f4d2ce2dc962c39b67c7ce954dc69339886ab9530a6ca6a27ad25e2a9296cad95556a4bd45
@@ -1,6 +1,6 @@
1
1
  module Cordova
2
2
  # cordova-rake version
3
3
  module Rake
4
- VERSION = '0.3.1'
4
+ VERSION = '0.4.3'.freeze
5
5
  end
6
6
  end
data/lib/cordova/rake.rb CHANGED
@@ -4,15 +4,16 @@ require 'tilt'
4
4
  require 'paint'
5
5
  require 'nokogiri'
6
6
  require 'erb'
7
+
7
8
  START = Time.now
8
9
 
9
10
  #
10
11
  # Some helper methods
11
12
  #
12
13
  def get_sources(ext, dir = 'app')
13
- source_files = Rake::FileList.new("#{dir}/**/*.#{ext}") do |fl|
14
- fl.exclude("~*")
15
- fl.exclude(/^scratch\//)
14
+ Rake::FileList.new("#{dir}/**/*.#{ext}") do |fl|
15
+ fl.exclude('~*')
16
+ fl.exclude(%r{^scratch/})
16
17
  # fl.exclude { |f| `git ls-files #{f}`.empty? } # Only commited
17
18
  end
18
19
  end
@@ -21,9 +22,9 @@ def config(key)
21
22
  return @xml[key] if @xml
22
23
  xml = Nokogiri::XML(File.open('config.xml'))
23
24
  @xml = {
24
- app: xml.xpath("//xmlns:name").text,
25
- desc: xml.xpath("//xmlns:description").text,
26
- platforms: xml.xpath("//xmlns:platform").map { |os| os['name'] }
25
+ app: xml.xpath('//xmlns:name').text,
26
+ desc: xml.xpath('//xmlns:description').text,
27
+ platforms: xml.xpath('//xmlns:platform').map { |os| os['name'] }
27
28
  }
28
29
  config(key)
29
30
  end
@@ -14,7 +14,7 @@ class Erbs < OpenStruct
14
14
  end
15
15
  end
16
16
 
17
- CONFIG_YML = 'config/app.yml'
17
+ CONFIG_YML = 'config/app.yml'.freeze
18
18
 
19
19
  namespace :compile do
20
20
  task all: [:js, :css, :html, :vars]
@@ -3,6 +3,15 @@
3
3
  #
4
4
  task default: [:compile]
5
5
 
6
+ def find_or_create_file(name)
7
+ if File.exist?(name)
8
+ print Paint["#{name} already exists! Overwrite? [y/N] ", :red]
9
+ return unless STDIN.gets.chomp == 'y'
10
+ end
11
+ puts "Creating #{name}..."
12
+ FileUtils.cp(File.join(__dir__, '..', 'templates', name), '.')
13
+ end
14
+
6
15
  task :greet do
7
16
  puts Paint["Cordova Rake [#{env}] #{ENV['CORDOVA_PLATFORMS']}", :red]
8
17
  puts Paint[' ----', :red]
@@ -10,11 +19,12 @@ end
10
19
 
11
20
  desc 'Setup env for development'
12
21
  task :setup do
13
- puts Paint['Installing NPM stuff...', :red]
22
+ puts Paint['Installing NPM stuff...', :blue]
14
23
  sh 'npm -g install phonegap cordova coffee-script '
15
24
  sh 'npm -g install ios-deploy ios-sim ' if RUBY_PLATFORM =~ /darwin/
16
25
  puts Paint['Installing GEM stuff...', :red]
17
- sh 'gem install haml sass yamg guard guard-coffeelint'
26
+ find_or_create_file 'Gemfile'
27
+ sh 'bundle update'
18
28
  end
19
29
 
20
30
  task :report do
@@ -37,12 +47,7 @@ end
37
47
 
38
48
  desc 'Prepare & Ripple emulate'
39
49
  task :guard do
40
- if File.exist?('Guardfile')
41
- puts 'Guardfile already exists.'
42
- else
43
- puts 'Creating Guardfile...'
44
- FileUtils.cp(File.join(__FILE__, '..', 'templates', 'Guardfile'), '.')
45
- end
50
+ find_or_create_file('Guardfile')
46
51
  end
47
52
 
48
53
  namespace :emulate do
@@ -16,7 +16,7 @@ end
16
16
  namespace :release do
17
17
  # Make sure we have some dirs
18
18
  task :check_dirs do
19
- %w( .keys build ).each do |dir|
19
+ %w(.keys build).each do |dir|
20
20
  FileUtils.mkdir dir unless File.exist?(dir)
21
21
  end
22
22
  end
@@ -0,0 +1,9 @@
1
+ # Cordova Rake Gemfile
2
+ gem 'cordova-rake'
3
+ gem 'haml'
4
+ gem 'sass'
5
+ # Media
6
+ gem 'yamg'
7
+ # Work
8
+ gem 'guard'
9
+ gem 'guard-coffeelint'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cordova-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos Piccinini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-24 00:00:00.000000000 Z
11
+ date: 2016-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt
@@ -74,6 +74,7 @@ files:
74
74
  - lib/tasks/application.rake
75
75
  - lib/tasks/cordova.rake
76
76
  - lib/tasks/deploy.rake
77
+ - lib/templates/Gemfile
77
78
  - lib/templates/Guardfile
78
79
  homepage: http://github.com/nofxx/cordova-rake
79
80
  licenses:
@@ -95,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
96
  version: '0'
96
97
  requirements: []
97
98
  rubyforge_project:
98
- rubygems_version: 2.4.5.1
99
+ rubygems_version: 2.6.6
99
100
  signing_key:
100
101
  specification_version: 4
101
102
  summary: Rake tasks to help cordova development