juice 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bin/juice +4 -2
  2. data/lib/JSquish.rb +7 -4
  3. data/lib/juice.rb +1 -1
  4. metadata +1 -1
data/bin/juice CHANGED
@@ -27,8 +27,10 @@ module Juice
27
27
  end
28
28
 
29
29
  def self.build
30
- save_file = ARGV[1].nil? ? 'production.js' : ARGV[1]
31
- if File.exists?(save_file)
30
+ save_file = ARGV[1].nil? ? 'production.js' : ARGV[1]
31
+ if !File.exists?("juice.app")
32
+ puts "This doesn't seem to be a Juice Application"
33
+ elsif File.exists?(save_file)
32
34
  puts "#{save_file} already exists!"
33
35
  else
34
36
  app = ''
data/lib/JSquish.rb CHANGED
@@ -1,16 +1,19 @@
1
1
  class JSquish
2
2
  def self.parse(str)
3
+ # Strip one line comments
3
4
  s_comment_reg = /[\/]{2}.*/
4
5
  str = str.gsub(s_comment_reg,' ')
5
-
6
+
7
+ # String multiline comments
8
+ str = str.gsub(/\/\*[\s\S]*?\*\//m,' ')
9
+
6
10
  #Remove all extra space
7
11
  remove_regexes = [/\s+/]
8
12
  remove_regexes.each do |reg|
9
13
  str = str.gsub(reg,' ')
10
14
  end
11
-
12
- #comment_reg = /(\/*)(.|\s)+(\*\/)/
13
- #str = str.gsub(comment_reg,' ')
15
+
16
+
14
17
  # Return the string
15
18
  str
16
19
  end
data/lib/juice.rb CHANGED
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module Juice
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.3'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: juice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Baker