my-simon 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.
Files changed (6) hide show
  1. data/README.md +39 -3
  2. data/VERSION +1 -1
  3. data/bin/simon +3 -3
  4. data/lib/simon.rb +36 -0
  5. data/my-simon.gemspec +1 -1
  6. metadata +2 -2
data/README.md CHANGED
@@ -1,4 +1,40 @@
1
- simon-cli
2
- =========
1
+ My-Simon ( ͡° ͜ʖ ͡°)
2
+ =====
3
+
4
+ Simple PHP MVC Boilerplate / Scaffolding
5
+
6
+
7
+ Think rails but dummer (and simpler). Does it make sense to make a Ruby gem for a php framework? No. Does it matter? No.
8
+
9
+
10
+
11
+ Using Simon to setup the boilerplate
12
+ ```php
13
+ gem install my-simon
14
+ ```
15
+
16
+ Create a new simon project in current folder
17
+ ```php
18
+ simon create
19
+ ```
20
+
21
+ Using Simon to add a new section
22
+ ```php
23
+ simon add section
24
+ ```
25
+
26
+ Using Simon to add [Heroku](http://heroku.com/) PHP compatability
27
+ ```php
28
+ simon add heroku
29
+ ```
30
+
31
+ Using Simon to add a javascript file to be downloaded locally and to add it to the footer
32
+ ```php
33
+ simon add js [url to js file]
34
+ ```
35
+
36
+ Using Simon to add basic Backbone
37
+ ```php
38
+ simon add backbone
39
+ ```
3
40
 
4
- Cli Editor for https://github.com/samcreate/Simon
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
data/bin/simon CHANGED
@@ -19,7 +19,7 @@ require 'commander/import'
19
19
  simon_controller = Simon.new
20
20
  svn_path = "https://samcreate@evolveit.svn.beanstalkapp.com/project_boilerplate/trunk/default"
21
21
  svn_path_heroku = "https://samcreate@evolveit.svn.beanstalkapp.com/project_boilerplate/trunk/heroku"
22
- program :version, '0.3.3'
22
+ program :version, '0.3.4'
23
23
  program :description, 'CLI tool for Simon, a simple MVC boilerplate'
24
24
 
25
25
  command :create do |c|
@@ -71,9 +71,9 @@ command :add do |c|
71
71
  simon_controller.msg "installing heroku files"
72
72
  when 'section'
73
73
  simon_controller.add_section
74
- when 'test'
75
-
74
+ when 'backbone'
76
75
 
76
+ simon_controller.add_backbone
77
77
 
78
78
  end
79
79
  end
@@ -229,6 +229,42 @@ class Simon
229
229
 
230
230
  end
231
231
 
232
+ def add_backbone
233
+
234
+ self.check_hidden
235
+
236
+ # get backbone js included
237
+ @bb_source = open("http://backbonejs.org/backbone-min.js") {|f| f.read }
238
+ js_endpoint = "./www/js/plugins/backbone-min.js"
239
+ cmd = "touch #{js_endpoint}"
240
+ Kernel::system( cmd );
241
+ File.open(js_endpoint, 'w') { |file| file.write(@bb_source) }
242
+ self.replace_once("./www/php/template/footer.php", "<!-- END: plugins -->", "<script src=\"/js/plugins/backbone-min.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n\t\t<!-- END: plugins -->");
243
+ self.replace_once("./www/js/master.js", "\*\/", "\* @depends plugins/backbone-min.js \n \*\/");
244
+
245
+ # setup director structure
246
+ cmd = "mkdir ./www/js/app && mkdir ./www/js/app/views && mkdir ./www/js/app/models && mkdir ./www/js/app/collections"
247
+ Kernel::system( cmd );
248
+
249
+ # add application
250
+ javascript_startpoint = "./scaffolding/standards/backbone/app.js";
251
+ javascript_endpoint = "./www/js/app/app.js";
252
+ cmd = "cp #{javascript_startpoint} #{javascript_endpoint}"
253
+ Kernel::system( cmd );
254
+ self.replace_once("./www/php/template/footer.php", "<!-- END: app -->", "<script src=\"/js/app/app.js\" type=\"text/javascript\" charset=\"utf-8\"></script>\n\t\t<!-- END: app -->");
255
+ self.replace_once("./www/js/master.js", "\*\/", "\* @depends app/app.js \n \*\/");
256
+
257
+ # message log to the user
258
+ self.msg "./www/js/app/views added"
259
+ self.msg "./www/js/app/models added"
260
+ self.msg "./www/js/app/collections added"
261
+ self.msg "./www/js/plugins/backbone-min.js added"
262
+ self.msg "./www/js/app/app.js added"
263
+ self.msg "./www/php/template/footer.php modified"
264
+ self.msg "./www/js/master.js modified"
265
+ self.complete
266
+ end
267
+
232
268
  # TODO get beanstalk to fix their shit.
233
269
  # def setup_beanstalk
234
270
  # subdomain = ask("What is the Beanstalk subdomain? : ") { |q| q.echo = true }
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "my-simon"
8
- s.version = "0.3.3"
8
+ s.version = "0.3.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aaron McGuire"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my-simon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -194,7 +194,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
194
194
  version: '0'
195
195
  segments:
196
196
  - 0
197
- hash: -4229138123181167283
197
+ hash: 3933374280299221007
198
198
  required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  none: false
200
200
  requirements: