scaffoldhub 0.0.11 → 0.0.12

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
- scaffoldhub (0.0.11)
4
+ scaffoldhub (0.0.12)
5
5
  rails
6
6
 
7
7
  GEM
@@ -10,7 +10,7 @@ module Erb
10
10
 
11
11
  def copy_view_files
12
12
  each_template_file(:view) do |erb_template_file|
13
- template erb_template_file.src, File.join("app/views", controller_file_path, erb_template_file.dest)
13
+ template erb_template_file.src, File.join("app/views", controller_file_path, replace_name_tokens(erb_template_file.dest))
14
14
  end
15
15
  end
16
16
  end
data/lib/scaffoldhub.rb CHANGED
@@ -6,6 +6,6 @@ require 'scaffoldhub/helper'
6
6
  require 'scaffoldhub/runner'
7
7
 
8
8
  module Scaffoldhub
9
- VERSION = '0.0.11'
10
- SCAFFOLD_HUB_SERVER = 'scaffoldhub.org'
9
+ VERSION = '0.0.12'
10
+ SCAFFOLD_HUB_SERVER = 'www.scaffoldhub.org'
11
11
  end
@@ -75,9 +75,9 @@ module Scaffoldhub
75
75
  end
76
76
 
77
77
  def adjusted_base_url
78
- if base_url =~ /github.com\/(\w+\/\w+)\/(tree|blob)\/(.*)$/
78
+ if base_url =~ /github.com\/([^\s]+\/[^\s]+)\/(tree|blob)\/(.*)$/
79
79
  "https://github.com/#{$1}/raw/#{$3}"
80
- elsif base_url =~ /github.com\/(\w+\/\w+)\/?$/
80
+ elsif base_url =~ /github.com\/([^\s^\/]+\/[^\s^\/]+)\/?$/
81
81
  "https://github.com/#{$1}/raw/master"
82
82
  else
83
83
  base_url
data/spec/helper_spec.rb CHANGED
@@ -136,4 +136,19 @@ describe Scaffoldhub::Helper do
136
136
  end
137
137
 
138
138
  end
139
+
140
+ describe '#replace_name_tokens' do
141
+ subject { FakeGenerator.new(false) }
142
+ before do
143
+ subject.expects(:file_name).returns('person')
144
+ subject.expects(:file_name).returns(name = mock)
145
+ name.stubs(:pluralize).returns('people')
146
+ end
147
+ it 'should replace the NAME token' do
148
+ subject.replace_name_tokens('_NAME.html.erb').should == '_person.html.erb'
149
+ end
150
+ it 'should replace the PLURAL_NAME token' do
151
+ subject.replace_name_tokens('PLURAL_NAME.html.erb').should == 'people.html.erb'
152
+ end
153
+ end
139
154
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scaffoldhub
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 11
10
- version: 0.0.11
9
+ - 12
10
+ version: 0.0.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Shaughnessy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-10 00:00:00 -04:00
18
+ date: 2011-05-24 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency