forge 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/.document +5 -0
  2. data/.gitmodules +3 -0
  3. data/.rspec +1 -0
  4. data/Gemfile +24 -0
  5. data/Gemfile.lock +81 -0
  6. data/LICENSE +20 -0
  7. data/README.md +24 -0
  8. data/Rakefile +53 -0
  9. data/VERSION +1 -0
  10. data/bin/forge +12 -0
  11. data/features/create.feature +34 -0
  12. data/features/link.feature +14 -0
  13. data/features/step_definitions/forge_steps.rb +38 -0
  14. data/features/support/env.rb +17 -0
  15. data/forge.gemspec +135 -0
  16. data/layouts/config/config.json.erb +13 -0
  17. data/layouts/config/stylesheet_header.erb +11 -0
  18. data/layouts/default/functions/functions.php.erb +21 -0
  19. data/layouts/default/stylesheets/_reset.scss +5 -0
  20. data/layouts/default/stylesheets/_typography.scss +5 -0
  21. data/layouts/default/stylesheets/style.css.scss.erb +28 -0
  22. data/layouts/default/templates/404.php.erb +10 -0
  23. data/layouts/default/templates/archive.php.erb +11 -0
  24. data/layouts/default/templates/attachment.php.erb +34 -0
  25. data/layouts/default/templates/comments.php +2 -0
  26. data/layouts/default/templates/footer.php +9 -0
  27. data/layouts/default/templates/header.php.erb +30 -0
  28. data/layouts/default/templates/index.php +6 -0
  29. data/layouts/default/templates/page.php +18 -0
  30. data/layouts/default/templates/partials/loop.php.erb +30 -0
  31. data/layouts/default/templates/search.php.erb +14 -0
  32. data/layouts/default/templates/sidebar.php +9 -0
  33. data/layouts/default/templates/single.php.erb +32 -0
  34. data/layouts/lib/forge-settings/README.md +43 -0
  35. data/layouts/lib/forge-settings/classes/settings.php +11 -0
  36. data/layouts/lib/forge-settings/classes/settings/collection.php +190 -0
  37. data/layouts/lib/forge-settings/classes/settings/option.php +125 -0
  38. data/layouts/lib/forge-settings/classes/settings/option/select.php +30 -0
  39. data/layouts/lib/forge-settings/classes/settings/option/text.php +15 -0
  40. data/layouts/lib/forge-settings/classes/settings/section.php +56 -0
  41. data/lib/forge.rb +11 -0
  42. data/lib/forge/builder.rb +165 -0
  43. data/lib/forge/cli.rb +86 -0
  44. data/lib/forge/config.rb +63 -0
  45. data/lib/forge/error.rb +8 -0
  46. data/lib/forge/generator.rb +128 -0
  47. data/lib/forge/guard.rb +57 -0
  48. data/lib/forge/project.rb +91 -0
  49. data/lib/forge/version.rb +3 -0
  50. data/lib/guard/forge/assets.rb +31 -0
  51. data/lib/guard/forge/config.rb +31 -0
  52. data/lib/guard/forge/functions.rb +31 -0
  53. data/lib/guard/forge/templates.rb +28 -0
  54. data/spec/lib/forge/config_spec.rb +79 -0
  55. data/spec/lib/forge/project_spec.rb +34 -0
  56. data/spec/spec_helper.rb +13 -0
  57. metadata +263 -0
@@ -0,0 +1,28 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ module Guard
5
+ class ForgeTemplates < ::Guard::Guard
6
+ def initialize(watchers=[], options={})
7
+ super
8
+ end
9
+
10
+ def start
11
+ UI.info "Copying templates over"
12
+ ::Forge::Guard.builder.copy_templates
13
+ end
14
+
15
+ def run_all
16
+ UI.info "Rebuilding all templates"
17
+ ::Forge::Guard.builder.clean_templates
18
+ ::Forge::Guard.builder.copy_templates
19
+ end
20
+
21
+ # Called on file(s) modifications
22
+ def run_on_change(paths)
23
+ UI.info "Templates have changed, copying over"
24
+ ::Forge::Guard.builder.clean_templates
25
+ ::Forge::Guard.builder.copy_templates
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,79 @@
1
+
2
+ require 'forge/config'
3
+
4
+ describe Forge::Config do
5
+
6
+ def config_file
7
+ File.expand_path(File.join('~', '.forge', 'config.yml'))
8
+ end
9
+
10
+ before(:each) do
11
+ @buffer = StringIO.new
12
+ @config = Forge::Config.new
13
+ end
14
+
15
+ it "should provide empty config object by default" do
16
+ @config.config.should == {
17
+ :theme => {
18
+ :author => nil,
19
+ :author_url => nil
20
+ },
21
+ :links => []
22
+ }
23
+ end
24
+
25
+ it "should allow access to config variables through []" do
26
+ @config[:links].should == []
27
+ end
28
+
29
+ it "should allow config options to be changed through []" do
30
+ @config[:links] = ['/var/www/wordpress']
31
+ @config[:links].should == ['/var/www/wordpress']
32
+ end
33
+
34
+ it "should store config in ~/.forge/config.yml" do
35
+ @config.config_file.should == config_file
36
+ end
37
+
38
+ it "should write default configuration to yaml" do
39
+ @config.write(:io => @buffer)
40
+ @buffer.string.should == "---\n:theme:\n :author: !!null \n :author_url: !!null \n:links: []\n"
41
+ end
42
+
43
+ describe :write do
44
+ it "should dump any changes made to the config" do
45
+ @config[:theme][:author] = "Matt Button"
46
+ @config[:theme][:author_url] = "http://that-matt.com"
47
+
48
+ @config.write(:io => @buffer)
49
+ @buffer.string.should == "---\n:theme:\n :author: Matt Button\n :author_url: http://that-matt.com\n:links: []\n"
50
+ end
51
+ end
52
+
53
+ describe :read do
54
+ it "should call #write if the file does not exist" do
55
+ File.should_receive(:exists?).with(config_file).and_return(false)
56
+ Psych.should_not_receive(:load_file)
57
+
58
+ @config.should_receive(:write)
59
+ @config.read
60
+ end
61
+
62
+ it "should not call #write if the config file exists" do
63
+ File.should_receive(:exists?).with(config_file).and_return(true)
64
+ Psych.should_receive(:load_file).with(config_file)
65
+
66
+ @config.should_not_receive(:write)
67
+ @config.read
68
+ end
69
+
70
+ it "should load config from yaml file" do
71
+ File.stub!(:exists?).and_return(true)
72
+ Psych.stub!(:load_file).and_return({:theme => {:author => 'Drew'}, :links => []})
73
+
74
+ @config.read
75
+ @config[:links].should == []
76
+ @config[:theme].should == {:author => 'Drew'}
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,34 @@
1
+
2
+ require 'forge/project'
3
+
4
+ describe Forge::Project do
5
+ before(:each) do
6
+ @project = Forge::Project.new('/tmp/', nil, {:name => 'Hello'})
7
+ end
8
+
9
+ describe :config_file do
10
+ it "should create an expanded path to the config file" do
11
+ @project.config_file.should == '/tmp/config.json'
12
+ end
13
+ end
14
+
15
+ describe :assets_path do
16
+ it "should create an expanded path to the assets folder" do
17
+ @project.assets_path.should == '/tmp/assets'
18
+ end
19
+ end
20
+
21
+
22
+ describe :build_dir do
23
+ it "should create an expanded path to the forge build directory" do
24
+ @project.build_dir.should == '/tmp/.forge'
25
+ end
26
+ end
27
+
28
+ describe :theme_id do
29
+ it "should be the same as the project folder" do
30
+ @project.theme_id.should == 'tmp'
31
+ end
32
+ end
33
+
34
+ end
@@ -0,0 +1,13 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'forge'
5
+
6
+ p "HEY"
7
+ # Requires supporting files with custom matchers and macros, etc,
8
+ # in ./support/ and its subdirectories.
9
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
10
+
11
+ RSpec.configure do |config|
12
+
13
+ end
metadata ADDED
@@ -0,0 +1,263 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: forge
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Andy Adams
9
+ - Drew Strojny
10
+ - Matt Button
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+ date: 2011-10-06 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: thor
18
+ requirement: &2153138780 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: '0'
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: *2153138780
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard
29
+ requirement: &2152836320 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: *2152836320
38
+ - !ruby/object:Gem::Dependency
39
+ name: sprockets
40
+ requirement: &2152834580 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: *2152834580
49
+ - !ruby/object:Gem::Dependency
50
+ name: rubyzip
51
+ requirement: &2152832060 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: *2152832060
60
+ - !ruby/object:Gem::Dependency
61
+ name: json
62
+ requirement: &2152825320 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: *2152825320
71
+ - !ruby/object:Gem::Dependency
72
+ name: sass
73
+ requirement: &2152809600 !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: *2152809600
82
+ - !ruby/object:Gem::Dependency
83
+ name: sprockets-sass
84
+ requirement: &2152805540 !ruby/object:Gem::Requirement
85
+ none: false
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: *2152805540
93
+ - !ruby/object:Gem::Dependency
94
+ name: compass
95
+ requirement: &2152799460 !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ! '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ type: :runtime
102
+ prerelease: false
103
+ version_requirements: *2152799460
104
+ - !ruby/object:Gem::Dependency
105
+ name: rspec
106
+ requirement: &2152795060 !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ type: :development
113
+ prerelease: false
114
+ version_requirements: *2152795060
115
+ - !ruby/object:Gem::Dependency
116
+ name: cucumber
117
+ requirement: &2152780560 !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ! '>='
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ type: :development
124
+ prerelease: false
125
+ version_requirements: *2152780560
126
+ - !ruby/object:Gem::Dependency
127
+ name: aruba
128
+ requirement: &2152777760 !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: *2152777760
137
+ - !ruby/object:Gem::Dependency
138
+ name: bundler
139
+ requirement: &2152776020 !ruby/object:Gem::Requirement
140
+ none: false
141
+ requirements:
142
+ - - ~>
143
+ - !ruby/object:Gem::Version
144
+ version: 1.0.0
145
+ type: :development
146
+ prerelease: false
147
+ version_requirements: *2152776020
148
+ - !ruby/object:Gem::Dependency
149
+ name: jeweler
150
+ requirement: &2152774320 !ruby/object:Gem::Requirement
151
+ none: false
152
+ requirements:
153
+ - - ~>
154
+ - !ruby/object:Gem::Version
155
+ version: 1.6.4
156
+ type: :development
157
+ prerelease: false
158
+ version_requirements: *2152774320
159
+ - !ruby/object:Gem::Dependency
160
+ name: rcov
161
+ requirement: &2152773220 !ruby/object:Gem::Requirement
162
+ none: false
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ type: :development
168
+ prerelease: false
169
+ version_requirements: *2152773220
170
+ description: A toolkit for bootstrapping and developing WordPress themes.
171
+ email: aadams@jestro.com
172
+ executables:
173
+ - forge
174
+ extensions: []
175
+ extra_rdoc_files:
176
+ - LICENSE
177
+ - README.md
178
+ files:
179
+ - .document
180
+ - .gitmodules
181
+ - .rspec
182
+ - Gemfile
183
+ - Gemfile.lock
184
+ - LICENSE
185
+ - README.md
186
+ - Rakefile
187
+ - VERSION
188
+ - bin/forge
189
+ - features/create.feature
190
+ - features/link.feature
191
+ - features/step_definitions/forge_steps.rb
192
+ - features/support/env.rb
193
+ - forge.gemspec
194
+ - layouts/config/config.json.erb
195
+ - layouts/config/stylesheet_header.erb
196
+ - layouts/default/functions/functions.php.erb
197
+ - layouts/default/stylesheets/_reset.scss
198
+ - layouts/default/stylesheets/_typography.scss
199
+ - layouts/default/stylesheets/style.css.scss.erb
200
+ - layouts/default/templates/404.php.erb
201
+ - layouts/default/templates/archive.php.erb
202
+ - layouts/default/templates/attachment.php.erb
203
+ - layouts/default/templates/comments.php
204
+ - layouts/default/templates/footer.php
205
+ - layouts/default/templates/header.php.erb
206
+ - layouts/default/templates/index.php
207
+ - layouts/default/templates/page.php
208
+ - layouts/default/templates/partials/loop.php.erb
209
+ - layouts/default/templates/search.php.erb
210
+ - layouts/default/templates/sidebar.php
211
+ - layouts/default/templates/single.php.erb
212
+ - layouts/lib/forge-settings/README.md
213
+ - layouts/lib/forge-settings/classes/settings.php
214
+ - layouts/lib/forge-settings/classes/settings/collection.php
215
+ - layouts/lib/forge-settings/classes/settings/option.php
216
+ - layouts/lib/forge-settings/classes/settings/option/select.php
217
+ - layouts/lib/forge-settings/classes/settings/option/text.php
218
+ - layouts/lib/forge-settings/classes/settings/section.php
219
+ - lib/forge.rb
220
+ - lib/forge/builder.rb
221
+ - lib/forge/cli.rb
222
+ - lib/forge/config.rb
223
+ - lib/forge/error.rb
224
+ - lib/forge/generator.rb
225
+ - lib/forge/guard.rb
226
+ - lib/forge/project.rb
227
+ - lib/forge/version.rb
228
+ - lib/guard/forge/assets.rb
229
+ - lib/guard/forge/config.rb
230
+ - lib/guard/forge/functions.rb
231
+ - lib/guard/forge/templates.rb
232
+ - spec/lib/forge/config_spec.rb
233
+ - spec/lib/forge/project_spec.rb
234
+ - spec/spec_helper.rb
235
+ homepage: http://nohomepageyet.org
236
+ licenses:
237
+ - MIT
238
+ post_install_message:
239
+ rdoc_options: []
240
+ require_paths:
241
+ - lib
242
+ required_ruby_version: !ruby/object:Gem::Requirement
243
+ none: false
244
+ requirements:
245
+ - - ! '>='
246
+ - !ruby/object:Gem::Version
247
+ version: '0'
248
+ segments:
249
+ - 0
250
+ hash: 689704686126272199
251
+ required_rubygems_version: !ruby/object:Gem::Requirement
252
+ none: false
253
+ requirements:
254
+ - - ! '>='
255
+ - !ruby/object:Gem::Version
256
+ version: '0'
257
+ requirements: []
258
+ rubyforge_project:
259
+ rubygems_version: 1.8.11
260
+ signing_key:
261
+ specification_version: 3
262
+ summary: A tool for developing wordpress themes
263
+ test_files: []