jsg 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/jsg +3 -2
- data/jsg.rb +6 -1
- data/lib/jsg/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e678932e88c5f4332664d8f94c855c6cf5c37eccb4c0ff55779061d20ee7a8f
|
4
|
+
data.tar.gz: eded22db06e19449e076d82332e9aa00db620fff95fd6c69d1b3a6710815eb2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7f34af3bdec9dd82ed50497bbe141bfd95c2bfc8dd0417fa9312a2893ce1547ddeb438d806070f151693aef6695bfd8fd79571fc010edcdf66dd72b84a8b742
|
7
|
+
data.tar.gz: 1cb61dbdeb8b53b6697e3521b86ef0db32e3050d66ac69fc658a7a22601cc3a6c62fe08c402e205a7378546f9f8761cfdd6914063b93881f3c45204badab815c
|
data/exe/jsg
CHANGED
@@ -19,8 +19,7 @@ module JSG
|
|
19
19
|
Dir.glob("#{base_path}/**/*").each do |file_path|
|
20
20
|
next if File.directory?(file_path)
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
|
24
23
|
content = File.read(file_path)
|
25
24
|
result = if file_path.end_with?(".erb")
|
26
25
|
template = ERB.new(content)
|
@@ -32,6 +31,8 @@ module JSG
|
|
32
31
|
relative_path = file_path.sub("#{base_path}/", "").gsub(/\.erb$/, "")
|
33
32
|
new_file_path = File.join(destination, relative_path)
|
34
33
|
|
34
|
+
p new_file_path
|
35
|
+
|
35
36
|
new_file_path.gsub!("gitignore", ".gitignore")
|
36
37
|
FileUtils.mkdir_p(File.dirname(new_file_path))
|
37
38
|
File.write(new_file_path, result)
|
data/jsg.rb
CHANGED
@@ -154,6 +154,7 @@ end
|
|
154
154
|
# Applying the JSG module to JS::Object to patch existing methods and add new ones
|
155
155
|
class JS::Object
|
156
156
|
include JSGPatch
|
157
|
+
|
157
158
|
end
|
158
159
|
|
159
160
|
# Extending the JS module to include new class methods
|
@@ -163,6 +164,8 @@ module JS
|
|
163
164
|
end
|
164
165
|
|
165
166
|
module JSG
|
167
|
+
class Error < StandardError; end
|
168
|
+
|
166
169
|
def self.window(*args)
|
167
170
|
JS.send(:global, *args)
|
168
171
|
end
|
@@ -179,6 +182,8 @@ module JSG
|
|
179
182
|
singleton_class.alias_method :d, :document
|
180
183
|
singleton_class.alias_method :q, :querySelectorAll
|
181
184
|
|
185
|
+
|
186
|
+
|
182
187
|
def self.method_missing(method, *args, &block)
|
183
188
|
if JS.respond_to?(method)
|
184
189
|
JS.send(method, *args, &block)
|
@@ -190,4 +195,4 @@ module JSG
|
|
190
195
|
def self.respond_to_missing?(method, include_private = false)
|
191
196
|
JS.respond_to?(method, include_private) || super
|
192
197
|
end
|
193
|
-
end
|
198
|
+
end
|
data/lib/jsg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erb
|