From b63bfc21cce7d26029d0866256bd0f9950499b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=83=20pitr?= Date: Mon, 1 Feb 2016 09:18:14 -0500 Subject: [PATCH 1/5] remove support for Rails 4.2+ in branch 0.x --- .travis.yml | 13 +++---------- Gemfile | 2 +- README.md | 2 ++ angular-rails-templates.gemspec | 2 +- gemfiles/{rails_4.gemfile => rails_4.0.gemfile} | 3 +-- gemfiles/rails_4.1.gemfile | 8 ++++++++ 6 files changed, 16 insertions(+), 14 deletions(-) rename gemfiles/{rails_4.gemfile => rails_4.0.gemfile} (80%) create mode 100644 gemfiles/rails_4.1.gemfile diff --git a/.travis.yml b/.travis.yml index 3b03796..20c13a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,8 @@ rvm: - - 1.9.3 - - 2.0.0 + - 2.2.2 - jruby-19mode - - ruby-head - -matrix: - allow_failures: - - rvm: ruby-head - - gemfile: gemfiles/rails_head.gemfile gemfile: - gemfiles/rails_3.gemfile - - gemfiles/rails_4.gemfile - - gemfiles/rails_head.gemfile + - gemfiles/rails_4.0.gemfile + - gemfiles/rails_4.1.gemfile diff --git a/Gemfile b/Gemfile index 8dedc1b..9ce1691 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source "https://rubygems.org" gem "rails", "~> 4.1.0" -gem "slim" +gem "slim-rails" gem "haml" gem "kramdown" diff --git a/README.md b/README.md index 9fd3af0..50c1149 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Adds your HTML templates into Angular's `$templateCache` using Rails asset pipeline. +**IMPORTANT**: for Rails 4.2+ use version 1.0+ of this gem. For Rails 3 - 4.1 use version 0.x + It removes the need for AJAX calls to retrieve the templates (or for you to manually set them into the DOM). ## Usage diff --git a/angular-rails-templates.gemspec b/angular-rails-templates.gemspec index 03b7017..5ae84e1 100644 --- a/angular-rails-templates.gemspec +++ b/angular-rails-templates.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] s.add_dependency "railties", ">= 3.1" - s.add_dependency "sprockets", "~> 2" + s.add_dependency "sprockets", "~> 2.0" s.add_dependency "tilt" s.add_development_dependency "minitest" diff --git a/gemfiles/rails_4.gemfile b/gemfiles/rails_4.0.gemfile similarity index 80% rename from gemfiles/rails_4.gemfile rename to gemfiles/rails_4.0.gemfile index 28f88b7..a5762af 100644 --- a/gemfiles/rails_4.gemfile +++ b/gemfiles/rails_4.0.gemfile @@ -1,9 +1,8 @@ source "https://rubygems.org" -gem "rails", "~> 4.0.1" +gem "rails", "~> 4.0.0" gem "slim-rails" gem "haml" gem "kramdown" - gemspec :path => ".././" diff --git a/gemfiles/rails_4.1.gemfile b/gemfiles/rails_4.1.gemfile new file mode 100644 index 0000000..334b99b --- /dev/null +++ b/gemfiles/rails_4.1.gemfile @@ -0,0 +1,8 @@ +source "https://rubygems.org" + +gem "rails", "~> 4.1.0" +gem "slim-rails" +gem "haml" +gem "kramdown" + +gemspec :path => ".././" From d85f1d090c110778b25d94a13e5cdd3b460ced76 Mon Sep 17 00:00:00 2001 From: sugarskull Date: Fri, 6 May 2016 21:55:56 -0700 Subject: [PATCH 2/5] Fixes #113 for Rails 4.1 and earlier --- lib/angular-rails-templates/template.rb | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/angular-rails-templates/template.rb b/lib/angular-rails-templates/template.rb index d54b309..6dc6570 100644 --- a/lib/angular-rails-templates/template.rb +++ b/lib/angular-rails-templates/template.rb @@ -14,18 +14,22 @@ def prepare # we only want to process html assets inside those specified in configuration.inside_paths @asset_should_be_processed = configuration.inside_paths.any? { |folder| file.match(folder.to_s) } + unless @asset_should_be_processed + @data = nil + return + end + if configuration.htmlcompressor and @asset_should_be_processed @data = compress data end end def evaluate(scope, locals, &block) - locals[:html] = escape_javascript data.chomp - locals[:angular_template_name] = logical_template_path(scope) - locals[:source_file] = "#{scope.pathname}".sub(/^#{Rails.root}\//,'') - locals[:angular_module] = configuration.module_name - if @asset_should_be_processed + locals[:html] = escape_javascript data.chomp + locals[:angular_template_name] = logical_template_path(scope) + locals[:source_file] = "#{scope.pathname}".sub(/^#{Rails.root}\//,'') + locals[:angular_module] = configuration.module_name AngularJsTemplateWrapper.render(scope, locals) else data From 480060004c2fc3d2d827a5bbee22ba3e5877037a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=83=20pitr?= Date: Mon, 9 May 2016 11:28:21 -0400 Subject: [PATCH 3/5] specify mime-types < 3 due to requirement for ruby 2.0 --- angular-rails-templates.gemspec | 1 + 1 file changed, 1 insertion(+) diff --git a/angular-rails-templates.gemspec b/angular-rails-templates.gemspec index 5ae84e1..6498df8 100644 --- a/angular-rails-templates.gemspec +++ b/angular-rails-templates.gemspec @@ -22,5 +22,6 @@ Gem::Specification.new do |s| s.add_development_dependency "minitest" s.add_development_dependency "capybara" + s.add_development_dependency "mime-types", "< 3" s.add_development_dependency "uglifier" end From 0d36792c1811738c56b1d3ae17f3678e8409c947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=83=20pitr?= Date: Wed, 18 Jan 2017 09:14:47 -0500 Subject: [PATCH 4/5] bump to 0.3.0 --- README.md | 2 +- lib/angular-rails-templates/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50c1149..84c0f54 100644 --- a/README.md +++ b/README.md @@ -217,7 +217,7 @@ config.angular_templates.htmlcompressor = { ## License -MIT License. Copyright 2014 Pitr +MIT License. Copyright 2017 pitr ## Authors & contributors diff --git a/lib/angular-rails-templates/version.rb b/lib/angular-rails-templates/version.rb index ab4e85d..3537262 100644 --- a/lib/angular-rails-templates/version.rb +++ b/lib/angular-rails-templates/version.rb @@ -1,3 +1,3 @@ module AngularRailsTemplates - VERSION = '0.2.0' + VERSION = '0.3.0' end From 933f48fd23c02b76597b0494caacc56126d7c9dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=83=20pitr?= Date: Wed, 18 Jan 2017 09:17:43 -0500 Subject: [PATCH 5/5] update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b65a9d4..d640559 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ### Future +### 0.3.0 + +- specify mime-types < 3 due to requirement for ruby 2.0 [pitr] +- fix bug where html files outside of inside_paths were still being processed [sugarskull, #137] +- remove support for Rails 4.2+ in branch 0.x [pitr] + ### 0.2.0 - Add config.angular_templates.inside_paths [sars, #90]