Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7275b1c

Browse files
committed
[RAILS] Updated the 04-dsl template
* Remove Sass and Coffeescript assets * Copy files from Github rather than locally
1 parent 2f2c0fb commit 7275b1c

File tree

1 file changed

+12
-9
lines changed
  • elasticsearch-rails/lib/rails/templates

1 file changed

+12
-9
lines changed

‎elasticsearch-rails/lib/rails/templates/04-dsl.rb‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/04-dsl.rb
1+
# $ rails new searchapp --skip --skip-bundle --template https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/04-dsl.rb
22

33
# (See: 01-basic.rb, 02-pretty.rb, 03-expert.rb)
44

@@ -15,13 +15,16 @@
1515
git add: "README.rdoc"
1616
git commit: "-m '[03] Updated the application README'"
1717

18+
run 'rm -f app/assets/stylesheets/*.scss'
19+
run 'rm -f app/assets/javascripts/*.coffee'
20+
1821
# ----- Add gems into Gemfile ---------------------------------------------------------------------
1922

2023
puts
2124
say_status "Rubygems", "Adding Rubygems into Gemfile...\n", :yellow
2225
puts '-'*80, ''; sleep 0.25
2326

24-
gem "elasticsearch-dsl", git: "git://github.com/elasticsearch/elasticsearch-ruby.git",branch: 'dsl'
27+
gem "elasticsearch-dsl", git: "git://github.com/elastic/elasticsearch-ruby.git"
2528

2629
git add: "Gemfile*"
2730
git commit: "-m 'Added the `elasticsearch-dsl` gem'"
@@ -32,13 +35,13 @@
3235

3336
# ----- Change the search definition implementation and associated views and tests ----------------
3437

35-
copy_file File.expand_path('../searchable.dsl.rb', __FILE__), 'app/models/concerns/searchable.rb', force: true
36-
# get 'https://raw.github.com/elasticsearch/elasticsearch-rails/templates/elasticsearch-rails/lib/rails/templates/searchable.dsl.rb',
37-
# 'app/models/concerns/searchable.rb'
38+
# copy_file File.expand_path('../searchable.dsl.rb', __FILE__), 'app/models/concerns/searchable.rb', force: true
39+
get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/searchable.dsl.rb',
40+
'app/models/concerns/searchable.rb'
3841

39-
copy_file File.expand_path('../index.html.dsl.erb', __FILE__), 'app/views/search/index.html.erb', force: true
40-
# get 'https://raw.github.com/elasticsearch/elasticsearch-rails/templates/elasticsearch-rails/lib/rails/templates/index.html.dsl.erb',
41-
# 'app/views/search/index.html.erb'
42+
# copy_file File.expand_path('../index.html.dsl.erb', __FILE__), 'app/views/search/index.html.erb', force: true
43+
get 'https://raw.githubusercontent.com/elastic/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/index.html.dsl.erb',
44+
'app/views/search/index.html.erb'
4245

4346
gsub_file "test/controllers/search_controller_test.rb", %r{test "should return facets" do.*?end}m, <<-CODE
4447
test "should return aggregations" do
@@ -92,7 +95,7 @@
9295
CODE
9396

9497
git add: "app/models/concerns/ app/views/search/ test/controllers/search_controller_test.rb"
95-
git commit: "-m 'Updated the Article.search method to use the Ruby DSL; Updated the views and tests'"
98+
git commit: "-m 'Updated the Article.search method to use the Ruby DSL and updated the associated views and tests'"
9699

97100
# ----- Print Git log -----------------------------------------------------------------------------
98101

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /