SasquatchJS 0.1.0 → 0.1.1

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: bca6b695f88cf721ce0240a77881978afc8a9de1
4
- data.tar.gz: badd03e480275c7429582c0c364e6f29da679809
3
+ metadata.gz: bf8049504cc42c0448cc8cfd0aeadfe46417ddbd
4
+ data.tar.gz: d0c3af66d13030439c7f9ab1698cac538bf6e2f7
5
5
  SHA512:
6
- metadata.gz: 72eecb67d9da36913dfeb25061f9e45b626c67bf498595b836bbb0ea8fd58db264bf4a35ef5051e0bddce87e71d43d2368030903e361052bcc4fbc4993afd32f
7
- data.tar.gz: 838e0fcf90a7cb904e352bd84fa3729bf571d73634416d272ed919add7f52be0254bf62d49a96e104e38870c4970853511f181f242c60a060cee07e33d44562e
6
+ metadata.gz: 02878e3ec27bd841ae63e89735f4579db6a289d33505585711e70d2c6168d3a2afb7d9037a11141aea55e10ee4595ee26c2929421268a60234ccf94c2c762619
7
+ data.tar.gz: 87d1b30c279f1866d9e80ee6b8616b551d1baf64d926b9ba4d8d56b16feefcad0d4ba24118ffcce663cdf81650194fb2d519b8238925a5239df457d267760934
data/Rakefile CHANGED
@@ -23,7 +23,7 @@ Jeweler::Tasks.new do |gem|
23
23
  gem.authors = ["Chris Montes"]
24
24
  gem.files = `git ls-files`.split($/)
25
25
  gem.require_path= 'lib'
26
- gem.version = '0.1.0'
26
+ gem.version = '0.1.1'
27
27
  # dependencies defined in Gemfile
28
28
  end
29
29
  Jeweler::RubygemsDotOrgTasks.new
@@ -38,7 +38,8 @@ module Sasquatch
38
38
 
39
39
  # search the output buffer for the key and replace it with the import_file
40
40
  def import output_buffer, key, import_file
41
- output_buffer.sub(/\/\* @import #{key} \*\//, "/* Imports #{key} */ \n\n" + File.read(import_file.path()) + "\n")
41
+
42
+ output_buffer.sub(/\/\* @import ["']#{key}["']; \*\//, "/* Imports #{key} */ \n\n" + File.read(import_file.path()) + "\n")
42
43
  end
43
44
 
44
45
  end
@@ -5,12 +5,12 @@ module Sasquatch
5
5
  include Logger
6
6
  attr_reader :file, :files, :listener, :status, :base_path, :file_changed, :running
7
7
 
8
- def initialize file, &block
8
+ def initialize file, running = true, &block
9
9
  @file = file
10
10
 
11
11
  @base_path = File.dirname(@file)
12
12
 
13
- @running = true
13
+ @running = running
14
14
 
15
15
  validate_file @file
16
16
 
@@ -29,7 +29,7 @@ module Sasquatch
29
29
 
30
30
  def find_imports file
31
31
  @files = {}
32
- File.read(file).scan(/\/\* @import (.*.js)/) do |filename|
32
+ File.read(file).scan(/\/\* @import .+?(.*.js)/) do |filename|
33
33
  @import = "#{File.dirname(@file)}/#{filename.first}"
34
34
  validate_file @import
35
35
  @files[filename.first] = File.new(File.absolute_path(@import))
@@ -1,10 +1,10 @@
1
1
 
2
- /* @import test.js */
2
+ /* @import "test.js"; */
3
3
 
4
4
  function Application() {
5
5
  console.log('test');
6
6
  }
7
7
 
8
- /* @import test-2.js */
8
+ /* @import 'test-2.js'; */
9
9
 
10
- // 2013-12-10 01:28:58 -0800 line added by rspec
10
+ // 2013-12-10 03:52:37 -0800 line added by rspec
data/test/js/test-2.js CHANGED
@@ -1 +1 @@
1
- // test-2.js file
1
+ // test-2.js file
data/test/js/test.js CHANGED
@@ -5,4 +5,4 @@
5
5
  });
6
6
 
7
7
  })(jQuery);
8
- // 2013-12-10 01:29:00 -0800 line added by rspec
8
+ // 2013-12-10 03:52:39 -0800 line added by rspec
@@ -41,7 +41,7 @@ describe Sasquatch do
41
41
  end
42
42
 
43
43
  context "#Listener" do
44
- listener = Sasquatch::Listener.new('test/js/application.js')
44
+ listener = Sasquatch::Listener.new('test/js/application.js', false)
45
45
  # it should have a list of all imported files
46
46
  it "should have a list of all imported files" do
47
47
  files = ["test.js", "test-2.js"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SasquatchJS
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Montes