high_five 0.3.3 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 192f45c14ceb6b22f3295ec3b67a4286e02c6bbe
4
- data.tar.gz: 751b4ba435a73839670b0e707e664f8c5f60f190
3
+ metadata.gz: 932099f62b8ec28afb959082728cf512dcf606f1
4
+ data.tar.gz: 464a691c5287be6306ff4d7635621787db9dd1ec
5
5
  SHA512:
6
- metadata.gz: a941288a80cba76393d45cb6ed86f78c0f8532ee8fb68bc16db9ae4cbeda67ffc33c6635e1175030828aa032befb5135fe25dd07bc1b174741d7c1e284fa071c
7
- data.tar.gz: 9353ab1668fed5479928b871c269341bf59defe028a9ec59283b685d9cd731bbc2028ebe4f73c8d0bfe13d9e652455736cfa3ec569c82480f51159d29802638e
6
+ metadata.gz: ea8f0a5654d386aee3a820b98d645ae0451391e3f68b07ad17203c2bba1ec8b178bf6a1e58c9b635f9435ae8c842b8657aa3ed4dcd71e9bf5106241cdbc7df6b
7
+ data.tar.gz: feeb0b9091a8fcfb965730f75601479b8363464c402062fca96310ed61e2a861ba1d5dccf925c7a529eb3a3e4819e20583cd66f2cf414bc71d48c86508449c10
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- high_five (0.3.2)
4
+ high_five (0.3.4)
5
5
  chunky_png
6
6
  coffee-script (~> 2.2.0)
7
7
  compass (~> 0.12.2)
8
8
  multi_json (~> 1.0)
9
9
  nokogiri (>= 1.5.0)
10
10
  plist (>= 3.0)
11
- sprockets (>= 2.0)
11
+ sprockets (~> 2.12.3)
12
12
  thor (~> 0.18.0)
13
13
  uglifier (~> 2.1.1)
14
14
  webrick
@@ -28,8 +28,9 @@ GEM
28
28
  fssm (>= 0.2.7)
29
29
  sass (~> 3.2.19)
30
30
  diff-lcs (1.2.5)
31
- execjs (2.5.2)
31
+ execjs (2.6.0)
32
32
  fssm (0.2.10)
33
+ hike (1.2.3)
33
34
  method_source (0.8.2)
34
35
  mini_portile (0.6.2)
35
36
  multi_json (1.11.2)
@@ -51,9 +52,13 @@ GEM
51
52
  rspec-mocks (2.13.1)
52
53
  sass (3.2.19)
53
54
  slop (3.6.0)
54
- sprockets (3.2.0)
55
+ sprockets (2.12.4)
56
+ hike (~> 1.2)
57
+ multi_json (~> 1.0)
55
58
  rack (~> 1.0)
59
+ tilt (~> 1.1, != 1.3.0)
56
60
  thor (0.18.1)
61
+ tilt (1.4.1)
57
62
  uglifier (2.1.2)
58
63
  execjs (>= 0.3.0)
59
64
  multi_json (~> 1.0, >= 1.0.2)
data/high_five.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.add_runtime_dependency "compass", "~>0.12.2"
21
21
  s.add_runtime_dependency "yui-compressor", "~>0.12.0"
22
22
  s.add_runtime_dependency "uglifier", "~>2.1.1"
23
- s.add_runtime_dependency "sprockets", ">=2.0"
23
+ s.add_runtime_dependency "sprockets", "~>2.12.3"
24
24
  s.add_runtime_dependency "coffee-script", "~>2.2.0"
25
25
  s.add_runtime_dependency "plist", ">=3.0"
26
26
  s.add_runtime_dependency "nokogiri", ">=1.5.0"
@@ -52,9 +52,10 @@ module HighFive
52
52
  uuid = HighFive::IosHelper.uuid_from_mobileprovision(@provisioning_profile)
53
53
  ENV['uuid'] = uuid
54
54
  FileUtils.cp(@provisioning_profile, "#{ENV['HOME']}/Library/MobileDevice/Provisioning Profiles/#{uuid}.mobileprovision")
55
- system(%Q(cd "#{ios_path}";
55
+ system_or_die("rm #{ios_path}/build/*")
56
+ system_or_die(%Q(cd "#{ios_path}";
56
57
  /usr/bin/xcodebuild -target "#{ios_target}" -configuration Release clean build "CONFIGURATION_BUILD_DIR=#{ios_path}/build" "CODE_SIGN_IDENTITY=#{@sign_identity}" PROVISIONING_PROFILE=$uuid))
57
- system(%Q(/usr/bin/xcrun -sdk iphoneos PackageApplication -v "#{ios_path}/build/#{ios_target}.app" -o "#{ios_path}/build/#{@output_file_name}.ipa" --embed "#{@provisioning_profile}" --sign "#{@sign_identity}"))
58
+ system_or_die(%Q(/usr/bin/xcrun -sdk iphoneos PackageApplication -v "#{ios_path}/build/#{ios_target}.app" -o "#{ios_path}/build/#{@output_file_name}.ipa" --embed "#{@provisioning_profile}" --sign "#{@sign_identity}"))
58
59
  end
59
60
  end
60
61
 
@@ -64,8 +65,8 @@ module HighFive
64
65
  def dist_android(android_path)
65
66
  @output_file_name = options[:output_file_name]
66
67
  ant_flags = options[:"ant-flags"] || ""
67
- system("android update project --path #{android_path} --subprojects")
68
- system("ant -file '#{android_path}/build.xml' clean release #{ant_flags}")
68
+ system_or_die("android update project --path #{android_path} --subprojects")
69
+ system_or_die("ant -file '#{android_path}/build.xml' clean release #{ant_flags}")
69
70
 
70
71
  android_name = HighFive::AndroidHelper.project_name_from_build_xml("#{android_path}/build.xml")
71
72
 
@@ -77,11 +78,18 @@ module HighFive
77
78
 
78
79
  desc "install_android [ANDROID_PATH]", "Install the distribution package on the connected android device or emulator"
79
80
  def install_android(android_path)
80
- system("ant -file '#{android_path}/build.xml' installr")
81
+ system_or_die("ant -file '#{android_path}/build.xml' installr")
81
82
  end
82
83
 
83
84
  private
84
85
 
86
+ def system_or_die(cmd)
87
+ system(cmd)
88
+ if $?.exitstatus != 0
89
+ exit $?.exitstatus
90
+ end
91
+ end
92
+
85
93
  def config
86
94
  base_config.build_platform_config(@platform).build_platform_config(@environment)
87
95
  end
@@ -16,19 +16,29 @@ module HighFive
16
16
  method_option :target, :aliases => '-t', :desc => "Use a specific target (i.e. <Target>.plist"
17
17
  method_option :platform_path, :desc => "Path to ios or android directory"
18
18
  def set_version
19
- if (options[:version])
20
- puts "Changing version from #{plist["CFBundleShortVersionString"]} => #{options[:version]}"
21
- plist["CFBundleShortVersionString"] = options[:version]
19
+ if options[:version]
20
+ set_plist_property "CFBundleShortVersionString", options[:version]
22
21
  end
23
22
 
24
- if (options[:build_number])
25
- puts "Changind build number from #{plist["CFBundleVersion"]} => #{options[:build_number]}"
26
- plist["CFBundleVersion"] = options[:build_number]
23
+ if options[:build_number]
24
+ set_plist_property "CFBundleVersion", options[:build_number]
27
25
  end
28
- File.open(plist_path, 'w') do |f|
29
- f.write(Plist::Emit.dump(plist))
26
+
27
+ write_plist
28
+ end
29
+
30
+ desc "set_property", "Set an info.plist property"
31
+ method_option :key, :aliases => "-k", :desc => "Key to change"
32
+ method_option :value, :aliases => "-v", :desc => "New value for the specified key"
33
+ method_option :environment, :aliases => '-e', :desc => "environment"
34
+ method_option :target, :aliases => '-t', :desc => "Use a specific target (i.e. <Target>.plist"
35
+ method_option :platform_path, :desc => "Path to ios or android directory"
36
+ def set_property
37
+ unless options[:key] && options[:value]
38
+ raise "Need to set key and value options"
30
39
  end
31
- puts "Wrote #{plist_path} succesfully"
40
+ set_plist_property options[:key], options[:value]
41
+ write_plist
32
42
  end
33
43
 
34
44
  desc "set_icon", "Generate app icons from base png image"
@@ -62,6 +72,18 @@ module HighFive
62
72
 
63
73
  private
64
74
 
75
+ def set_plist_property(key, value)
76
+ puts "Changing #{key} from #{plist[key]} => #{value}"
77
+ plist[key] = value
78
+ end
79
+
80
+ def write_plist
81
+ File.open(plist_path, 'w') do |f|
82
+ f.write(Plist::Emit.dump(plist))
83
+ end
84
+ puts "Wrote #{plist_path} succesfully"
85
+ end
86
+
65
87
  def target
66
88
  options[:target] || base_config.build_platform_config(:ios).build_platform_config(options[:environment]).ios_target
67
89
  end
@@ -1,3 +1,3 @@
1
1
  module HighFive
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
File without changes
@@ -0,0 +1,59 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>API Endpoint</key>
6
+ <string>https://test.api.com/</string>
7
+ <key>CFBundleDevelopmentRegion</key>
8
+ <string>en</string>
9
+ <key>CFBundleExecutable</key>
10
+ <string>$(EXECUTABLE_NAME)</string>
11
+ <key>CFBundleIdentifier</key>
12
+ <string>com.cloudfiveapp.dummy.$(PRODUCT_NAME:rfc1034identifier)</string>
13
+ <key>CFBundleInfoDictionaryVersion</key>
14
+ <string>6.0</string>
15
+ <key>CFBundleName</key>
16
+ <string>$(PRODUCT_NAME)</string>
17
+ <key>CFBundlePackageType</key>
18
+ <string>APPL</string>
19
+ <key>CFBundleShortVersionString</key>
20
+ <string>1.0</string>
21
+ <key>CFBundleSignature</key>
22
+ <string>????</string>
23
+ <key>CFBundleVersion</key>
24
+ <string>1</string>
25
+ <key>LSRequiresIPhoneOS</key>
26
+ <true/>
27
+ <key>UIBackgroundModes</key>
28
+ <array>
29
+ <string>fetch</string>
30
+ </array>
31
+ <key>UILaunchStoryboardName</key>
32
+ <string>LaunchScreen</string>
33
+ <key>UIMainStoryboardFile</key>
34
+ <string>Main</string>
35
+ <key>UIStatusBarStyle</key>
36
+ <string>UIStatusBarStyleLightContent</string>
37
+ <key>UIStatusBarTintParameters</key>
38
+ <dict>
39
+ <key>UINavigationBar</key>
40
+ <dict>
41
+ <key>Style</key>
42
+ <string>UIBarStyleDefault</string>
43
+ <key>Translucent</key>
44
+ <false/>
45
+ </dict>
46
+ </dict>
47
+ <key>UISupportedInterfaceOrientations</key>
48
+ <array>
49
+ <string>UIInterfaceOrientationPortrait</string>
50
+ </array>
51
+ <key>UISupportedInterfaceOrientations~ipad</key>
52
+ <array>
53
+ <string>UIInterfaceOrientationPortrait</string>
54
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
55
+ <string>UIInterfaceOrientationLandscapeLeft</string>
56
+ <string>UIInterfaceOrientationLandscapeRight</string>
57
+ </array>
58
+ </dict>
59
+ </plist>
@@ -0,0 +1,45 @@
1
+ require 'spec_helper'
2
+ require 'chunky_png'
3
+
4
+ describe HighFive::Thor::Tasks::Ios do
5
+ include HighFive::TestHelper
6
+ include HighFive::IosHelper
7
+
8
+ before(:all) do
9
+ create_dummy_app!
10
+ HighFive::Config.configure do |config|
11
+ config.root = @project_root
12
+
13
+ config.destination = "www"
14
+ config.platform :ios do |ios|
15
+ ios.destination = 'ios/www'
16
+ end
17
+ end
18
+ end
19
+
20
+ after(:all) do
21
+ destroy_dummy_app!
22
+ end
23
+
24
+ context "Set version" do
25
+ it 'updates version number' do
26
+ cli(HighFive::Thor::Tasks::Ios, version: '2.0').set_version
27
+ plist = File.read(File.join(@project_root, 'ios', 'Info.plist'))
28
+ expect(plist).to match(/<key>CFBundleShortVersionString<\/key>\s+<string>2.0<\/string>/)
29
+ end
30
+ end
31
+
32
+ context "set_property" do
33
+ it 'updates changes a property' do
34
+ cli(HighFive::Thor::Tasks::Ios, key: 'Api Endpoint', value: 'https://api.different.com').set_property
35
+ plist = File.read(File.join(@project_root, 'ios', 'Info.plist'))
36
+ expect(plist).to match(/<key>Api Endpoint<\/key>\s+<string>https:\/\/api.different.com<\/string>/)
37
+ end
38
+
39
+ it 'adds a new property' do
40
+ cli(HighFive::Thor::Tasks::Ios, key: 'New Property', value: 'test').set_property
41
+ plist = File.read(File.join(@project_root, 'ios', 'Info.plist'))
42
+ expect(plist).to match(/<key>New Property<\/key>\s+<string>test<\/string>/)
43
+ end
44
+ end
45
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: high_five
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Samson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-05 00:00:00.000000000 Z
11
+ date: 2015-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: sprockets
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '2.0'
89
+ version: 2.12.3
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '2.0'
96
+ version: 2.12.3
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: coffee-script
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -246,6 +246,8 @@ files:
246
246
  - spec/dummy/config/high_five/app-web.js
247
247
  - spec/dummy/config/high_five/index.html.erb
248
248
  - spec/dummy/fake.mobileprovision
249
+ - spec/dummy/ios/Dummy.xcodeproj
250
+ - spec/dummy/ios/Info.plist
249
251
  - spec/dummy/javascripts/app.js
250
252
  - spec/dummy/javascripts/app/component.js
251
253
  - spec/dummy/public/custom_path/custom_app.js
@@ -255,6 +257,7 @@ files:
255
257
  - spec/dummy/test_icon.png
256
258
  - spec/init_spec.rb
257
259
  - spec/ios_helper_spec.rb
260
+ - spec/ios_tasks_spec.rb
258
261
  - spec/spec_helper.rb
259
262
  - template/config/high_five.rb
260
263
  - template/config/high_five/app-common.js
@@ -300,6 +303,8 @@ test_files:
300
303
  - spec/dummy/config/high_five/app-web.js
301
304
  - spec/dummy/config/high_five/index.html.erb
302
305
  - spec/dummy/fake.mobileprovision
306
+ - spec/dummy/ios/Dummy.xcodeproj
307
+ - spec/dummy/ios/Info.plist
303
308
  - spec/dummy/javascripts/app.js
304
309
  - spec/dummy/javascripts/app/component.js
305
310
  - spec/dummy/public/custom_path/custom_app.js
@@ -309,4 +314,5 @@ test_files:
309
314
  - spec/dummy/test_icon.png
310
315
  - spec/init_spec.rb
311
316
  - spec/ios_helper_spec.rb
317
+ - spec/ios_tasks_spec.rb
312
318
  - spec/spec_helper.rb