From f8fa5573c8425f12d31ab9ba5a189c5d060399a2 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Fri, 15 Apr 2011 16:00:25 -0400 Subject: [PATCH] no, wait, *now* i've got it right --- README.md | 4 ++-- bin/backbone-generator | 4 ++-- spec/bin/backbone-generator_spec.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fae3e41..bec61d6 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ Currently only works with Rails-ish projects and with Jasmine & Jammit. I'm self `backbone-generate model Admin::User` creates an AdminUserModel object in: -* `public/javascripts/models/admin/user_model.js` -* `spec/javascripts/models/admin/user_model_spec.js` +* `public/javascripts/models/admin/user.js` +* `spec/javascripts/models/admin/user_spec.js` ### View diff --git a/bin/backbone-generator b/bin/backbone-generator index 7eb139a..9480f75 100755 --- a/bin/backbone-generator +++ b/bin/backbone-generator @@ -24,8 +24,8 @@ class BackboneGenerator < Thor desc 'model Namespaced::Name', "Create a model" def model(name) @name = name - template('model.js.erb', "public/javascripts/models/#{underscore_name}_model.js") - template('model_spec.js.erb', "spec/javascripts/models/#{underscore_name}_model_spec.js") + template('model.js.erb', "public/javascripts/models/#{underscore_name}.js") + template('model_spec.js.erb', "spec/javascripts/models/#{underscore_name}_spec.js") end desc 'view Namespaced::Name', "Create a view" diff --git a/spec/bin/backbone-generator_spec.rb b/spec/bin/backbone-generator_spec.rb index 54d8685..303cc0c 100644 --- a/spec/bin/backbone-generator_spec.rb +++ b/spec/bin/backbone-generator_spec.rb @@ -15,8 +15,8 @@ describe 'backbone-generator' do it "should generate the model files" do system %{bin/backbone-generator model Section::Model} - File.file?(model = 'public/javascripts/models/section/model_model.js').should be_true - File.file?(spec = 'spec/javascripts/models/section/model_model_spec.js').should be_true + File.file?(model = 'public/javascripts/models/section/model.js').should be_true + File.file?(spec = 'spec/javascripts/models/section/model_spec.js').should be_true File.read(model).should match(/SectionModel/) File.read(spec).should match(/SectionModel/)