high_five 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- high_five (0.0.6)
4
+ high_five (0.0.7)
5
5
  compass (~> 0.12.2)
6
6
  json
7
7
  sprockets (~> 2.9.0)
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ High Five
2
+ =========
3
+
4
+ HTML5 build/deploy tool, usually used with PhoneGap.
5
+
6
+ Installation
7
+ ============
8
+
9
+ $ gem install high_five
10
+ $ cd my_mobile_project
11
+ $ hi5 init
12
+
13
+ This will bootstrap your project, creating a ```config``` directory if one isn't present,
14
+ and also creating a few important files inside, most importantly high_five.rb.
15
+
16
+ Configuration
17
+ =============
18
+
19
+
20
+ Usage
21
+ =====
22
+
23
+ $ hi5 deploy <platform> -e <environment>
24
+
25
+ This will build your application for a specific platform to the directory specified in high_five.rb.
26
+
27
+
@@ -13,7 +13,8 @@ module HighFive
13
13
  :platform_configs,
14
14
  :compass_dir,
15
15
  :js_settings, #serialized out to HighFive.Settings in index.html
16
- :is_environment #boolean for if this config is an environment platform
16
+ :is_environment, #boolean for if this config is an environment platform
17
+ :dev_index #copy generated index.html to here on build for use in development
17
18
 
18
19
 
19
20
  def self.configure(&block)
@@ -51,6 +52,7 @@ module HighFive
51
52
  new_config.sass_files += self.sass_files
52
53
  new_config.asset_paths += self.asset_paths
53
54
  new_config.compass_dir ||= self.compass_dir
55
+ new_config.dev_index ||= self.dev_index
54
56
  new_config.js_settings.merge! self.js_settings do |key, new_setting, old_setting|
55
57
  new_setting || old_setting #don't clobber settings from the parent
56
58
  end
@@ -74,6 +76,7 @@ module HighFive
74
76
  @js_settings = config.js_settings.dup
75
77
  self.root = config.root
76
78
  self.destination = config.destination
79
+ self.dev_index = config.dev_index
77
80
  self.page_title = config.page_title
78
81
  self.meta = config.meta
79
82
  else
@@ -130,5 +133,19 @@ module HighFive
130
133
  js += '</script>'
131
134
  js
132
135
  end
136
+
137
+ #easy setters
138
+
139
+ def dev_index(*args)
140
+ if args.length == 1
141
+ @dev_index = args[0]
142
+ end
143
+ @dev_index
144
+ end
145
+
146
+ def destination(*args)
147
+ @destination = args[0] if args.length == 1
148
+ @destination
149
+ end
133
150
  end
134
151
  end
@@ -121,6 +121,10 @@ module HighFive
121
121
  # Build index.html
122
122
  say "Generating index.html"
123
123
  template File.join(@config_root, "index.html.erb"), File.join(self.destination_root, "index.html")
124
+ if (@config.dev_index)
125
+ say "Cloning to #{@config.dev_index}"
126
+ FileUtils.cp(File.join(self.destination_root, "index.html"), File.join(@config.root, @config.dev_index))
127
+ end
124
128
  end
125
129
 
126
130
  private
@@ -0,0 +1 @@
1
+ html_includes.html.erb
@@ -1,3 +1,3 @@
1
1
  module HighFive
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
data/spec/config_spec.rb CHANGED
@@ -78,4 +78,27 @@ describe HighFive::Config do
78
78
  end
79
79
  end
80
80
 
81
+ context "easy settings" do
82
+ before do
83
+ HighFive::Config.configure do |config|
84
+ config.root = "/"
85
+ config.asset_paths = ["assets"]
86
+ config.dev_index "default.html"
87
+ config.platform :web do |web|
88
+ web.dev_index "index-debug.html"
89
+ end
90
+ end
91
+ @config = HighFive::Config.instance
92
+ end
93
+
94
+ it "should keep track of dev_index" do
95
+ @config.dev_index.should eq "default.html"
96
+ end
97
+
98
+ it "should override dev_index on a platform" do
99
+ platform_config = @config.build_platform_config('web')
100
+ platform_config.dev_index.should eq "index-debug.html"
101
+ end
102
+ end
103
+
81
104
  end
data/spec/deploy_spec.rb CHANGED
@@ -45,6 +45,7 @@ describe HighFive::DeployTask do
45
45
  File.join(@project_root, "www", "javascripts", "app").should exist
46
46
  File.join(@project_root, "www", "javascripts", "app", "component.js").should exist
47
47
  end
48
+
48
49
  end
49
50
 
50
51
  context "SASS Deployment" do
@@ -73,7 +74,31 @@ describe HighFive::DeployTask do
73
74
  pending "better compass integration"
74
75
  expect(File.join(@project_root, "www", "stylesheets", "screen.css")).to exist
75
76
  end
77
+ end
78
+
79
+ context "Development environment" do
80
+ before :all do
81
+ create_dummy_app!
82
+ HighFive::Config.configure do |config|
83
+ config.root = @project_root
84
+ config.destination = "www"
85
+ config.compass_dir = "."
86
+ config.assets "stylesheets"
87
+ config.platform :web do |web|
88
+ config.destination "www-web"
89
+ config.dev_index "index-debug.html"
90
+ end
91
+
92
+ cli.deploy("web")
93
+ end
94
+ end
76
95
 
96
+ it "should clone index.html to index-debug.html when directed" do
97
+ index = File.read(File.join(@project_root, "www-web", "index.html"))
98
+
99
+ index_debug = File.read(File.join(@project_root, "index-debug.html"))
100
+ index.should eq index_debug
101
+ end
77
102
  end
78
103
 
79
104
  end
@@ -0,0 +1,2 @@
1
+ // This file can be used to customize the javascript includes for a sepcific platform
2
+ //= require app-common
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: high_five
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-25 00:00:00.000000000 Z
12
+ date: 2013-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -124,6 +124,7 @@ files:
124
124
  - .ruby-version
125
125
  - Gemfile
126
126
  - Gemfile.lock
127
+ - README.md
127
128
  - Rakefile
128
129
  - bin/hi5
129
130
  - high_five.gemspec
@@ -133,6 +134,7 @@ files:
133
134
  - lib/high_five/cli.rb
134
135
  - lib/high_five/config.rb
135
136
  - lib/high_five/deploy_task.rb
137
+ - lib/high_five/html_includes.html.erb
136
138
  - lib/high_five/init_task.rb
137
139
  - lib/high_five/version.rb
138
140
  - spec/config_spec.rb
@@ -142,6 +144,7 @@ files:
142
144
  - spec/dummy/config/high_five/app-android.js
143
145
  - spec/dummy/config/high_five/app-common.js
144
146
  - spec/dummy/config/high_five/app-ios.js
147
+ - spec/dummy/config/high_five/app-web.js
145
148
  - spec/dummy/config/high_five/index.html.erb
146
149
  - spec/dummy/javascripts/app.js
147
150
  - spec/dummy/javascripts/app/component.js
@@ -190,6 +193,7 @@ test_files:
190
193
  - spec/dummy/config/high_five/app-android.js
191
194
  - spec/dummy/config/high_five/app-common.js
192
195
  - spec/dummy/config/high_five/app-ios.js
196
+ - spec/dummy/config/high_five/app-web.js
193
197
  - spec/dummy/config/high_five/index.html.erb
194
198
  - spec/dummy/javascripts/app.js
195
199
  - spec/dummy/javascripts/app/component.js