neutral 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e83ee56c8fc7a787238c1e0ba3c22111fb939fc1
4
- data.tar.gz: 0d4aa6e7ac6764008c1906a34fb9ce5020ea0c1a
3
+ metadata.gz: 47e943ceb407adc760f1479e7182d92ff5aee8a8
4
+ data.tar.gz: 50b736f3249bdcb0503edfdf12d3bf1832690bd0
5
5
  SHA512:
6
- metadata.gz: 270976a25f3af1dd261df7017f9fb5634dcfd16f2f4027696e9b6cfc26ccca3020a4ec105c79f937be4aa56e7121b8d0d6dde4ca3cc2e8581d07549a632d841d
7
- data.tar.gz: 4575c4016b18eba8ddcbaa1a98df2cb3212fd0729e08c0524875491779cb5ebcd0cfdfcc23872ebf514474fe9d76288b2c60273b9ad999e33976369706ae459b
6
+ metadata.gz: 7605723d401c0910676a5b8d2fddc03530b468815200fa454754dcc809c7aa3efb4fee9b0348b8103ef8096c4a87070472e06f6b80e595b7dcb501a02711265a
7
+ data.tar.gz: 59cdfe876d341064ff5db1344c70902af07369d2f4638f8088b86b674d5f6d4a693d1f18483252978bd4005776ce7dc41a6f46782bf1ee7c9aed8b597c35e5e1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neutral (0.0.4)
4
+ neutral (0.0.5)
5
5
  font-awesome-rails (~> 4.0.3.1)
6
6
  jquery-rails
7
7
  rails (~> 4.0.0)
@@ -26,7 +26,7 @@ module Neutral
26
26
  if File.binread(css_format[0]).include? "require neutral"
27
27
  say_status "skipped", "insert into '#{css_format[0]}'", :yellow
28
28
  else
29
- insert_into_file css_format[0], "\n#{css_format[1]} require neutral\n", after: /require_self/
29
+ insert_into_css
30
30
  end
31
31
  end
32
32
 
@@ -35,6 +35,14 @@ module Neutral
35
35
  end
36
36
 
37
37
  private
38
+ def insert_into_css
39
+ if File.binread(css_format[0]).include? "require_self"
40
+ insert_into_file css_format[0], "\n#{css_format[1]} require neutral\n", after: /require_self/
41
+ else
42
+ prepend_to_file css_format[0], "/*\n#{css_format[1]} require neutral\n*/\n"
43
+ end
44
+ end
45
+
38
46
  def self.next_migration_number(dirname)
39
47
  if ActiveRecord::Base.timestamped_migrations
40
48
  Time.now.utc.strftime("%Y%m%d%H%M%S%6N")
@@ -18,7 +18,7 @@ module Neutral
18
18
 
19
19
  def remove_stylesheet
20
20
  if File.binread(css_format[0]).include? "require neutral"
21
- gsub_file css_format[0], "\n#{css_format[1]} require neutral\n", ""
21
+ gsub_file css_format[0], /#{css_format[1]} require neutral/, ""
22
22
  else
23
23
  say_status("skipped", "remove from '#{css_format[0]}'", :yellow)
24
24
  end
@@ -1,3 +1,3 @@
1
1
  module Neutral
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neutral
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Tóth