jspp 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/bin/jspp +6 -6
  2. metadata +2 -2
data/bin/jspp CHANGED
@@ -27,11 +27,11 @@ multiline
27
27
 
28
28
  DIR = File.dirname ARGV.first || '.'
29
29
  R_INCLUDE = %r{/\*>\s*(.+?)\s*\*/}
30
- R_INCLUDE_INSIDE_STRING = Regexp.new('"' << R_INCLUDE.source << '"')
30
+ R_INCLUDE_INSIDE_STRING = %r{"#{R_INCLUDE.source}"}
31
31
 
32
32
 
33
- def get_file(path='')
34
- if path.index('http://') or path.index('https://')
33
+ def get_file path=''
34
+ if path.index'http://' or path.index'https://'
35
35
  require 'open-uri'
36
36
  open(path).read
37
37
  else
@@ -39,17 +39,17 @@ def get_file(path='')
39
39
  end
40
40
  end
41
41
 
42
- def parse(text='')
42
+ def parse text=''
43
43
  text.gsub!(R_INCLUDE_INSIDE_STRING) {
44
44
  '"' << parse(get_file $1).gsub(/$/, '\\').chop << '"'
45
45
  }
46
46
  text.gsub!(R_INCLUDE) {
47
- parse(get_file $1)
47
+ parse get_file $1
48
48
  }
49
49
  text
50
50
  end
51
51
 
52
- if $stdin.tty? and ARGV.empty? or ARGV.delete('-h') or ARGV.delete('--help')
52
+ if $stdin.tty? and ARGV.empty? or ARGV.delete'-h' or ARGV.delete'--help'
53
53
  puts HELP
54
54
  else
55
55
  print parse ARGF.read
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 6
9
- version: 0.1.6
8
+ - 8
9
+ version: 0.1.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nikita Vasilyev