sourcemap 0.0.2 → 0.1.0

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: d45b71f869e6eb34bf0c4307a3fce317e29eb35f
4
- data.tar.gz: cc38f062d61b03058b367fd1fd43108c75897dcd
3
+ metadata.gz: 730d8f2b240d048ff6a139f9bfab076264278182
4
+ data.tar.gz: 618f0dc85e2620f711a70f1e39d8cbc521631f1d
5
5
  SHA512:
6
- metadata.gz: a9c182c120450f8bcfe19a69c7b93b4898a19fb01f05f7773ff08943f79b9c3bb580eb2f35cf02ea2d6e1614d47a8610d0e21902675c570b46b46dbf9a32cae3
7
- data.tar.gz: ba03b03caae7ea67c1a4dcce63572ae751d979b91c03ca6d0f601ad09762d7a23f0c6ac74941538c8d2327de98ede248e54c7fc855306a2b130799387091ba84
6
+ metadata.gz: ee88fadd0c430c4598b5c0b404827ab25ac91fa615225e8a692f7cee687031bfcf4f3910e844682fd9097f4a62c864459fd967ff7acaa96fbce535d8388d995c
7
+ data.tar.gz: d244e76f334c282b8e92aff1ea473f4770dccaad3286becc98ac5782636a3c235ae4a4a37b771109c1271816375cfe70adbb47a8975498738f01bbe2103003df
@@ -1,8 +1,9 @@
1
+ language: ruby
2
+
1
3
  rvm:
2
4
  - 1.9.3
3
5
  - 2.0.0
4
- - jruby-19mode
5
- - rbx-19mode
6
+ - 2.1
6
7
 
7
8
  notifications:
8
9
  email: false
@@ -158,7 +158,7 @@ module SourceMap
158
158
  end
159
159
  end
160
160
 
161
- def as_json
161
+ def as_json(*)
162
162
  {
163
163
  "version" => 3,
164
164
  "file" => filename,
@@ -168,6 +168,10 @@ module SourceMap
168
168
  }
169
169
  end
170
170
 
171
+ def to_json(*a)
172
+ as_json.to_json(*a)
173
+ end
174
+
171
175
  # Public: Get a pretty inspect output for debugging purposes.
172
176
  #
173
177
  # Returns a String.
@@ -1,3 +1,3 @@
1
1
  module SourceMap
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -25,17 +25,19 @@ module SourceMap
25
25
  #
26
26
  # Returns a VLQ String.
27
27
  def self.encode(ary)
28
- result = ""
28
+ result = []
29
29
  ary.each do |n|
30
30
  vlq = n < 0 ? ((-n) << 1) + 1 : n << 1
31
- begin
31
+ loop do
32
32
  digit = vlq & VLQ_BASE_MASK
33
33
  vlq >>= VLQ_BASE_SHIFT
34
34
  digit |= VLQ_CONTINUATION_BIT if vlq > 0
35
35
  result << BASE64_DIGITS[digit]
36
- end while vlq > 0
36
+
37
+ break unless vlq > 0
38
+ end
37
39
  end
38
- result
40
+ result.join
39
41
  end
40
42
 
41
43
  # Public: Decode a VLQ string.
@@ -43,6 +43,8 @@ class TestMap < MiniTest::Test
43
43
  assert_equal hash['mappings'], map.to_s
44
44
 
45
45
  assert_equal hash, map.as_json
46
+ assert_equal hash.to_json, map.to_json
47
+ assert_equal hash.to_json, JSON.generate(map)
46
48
  end
47
49
 
48
50
  def test_map2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sourcemap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Peek
@@ -9,48 +9,48 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-24 00:00:00.000000000 Z
12
+ date: 2014-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '1.3'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: '1.3'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: minitest
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  description: Ruby source maps
@@ -60,8 +60,8 @@ executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - .gitignore
64
- - .travis.yml
63
+ - ".gitignore"
64
+ - ".travis.yml"
65
65
  - Gemfile
66
66
  - LICENSE
67
67
  - README.md
@@ -99,17 +99,17 @@ require_paths:
99
99
  - lib
100
100
  required_ruby_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - '>='
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - '>='
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.0.3
112
+ rubygems_version: 2.2.2
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Ruby source maps