rubyjs-vite 1.0.1 → 1.0.3

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
  SHA256:
3
- metadata.gz: 8f5d8e9992a474d2a8689effcf8359dc05e292fffa2ce2221481113b3c8a4a61
4
- data.tar.gz: 2a42b9944ec6aaed4634b66da95658523c64dc480df64725c122bec9ebede6b3
3
+ metadata.gz: 23e29f893a32c27dccaecfb2e4a1ca9f58b4dbf2a293bf083e2d18f91856de5f
4
+ data.tar.gz: b34cd11ca9673abb54cf10b24e555dcfa6003787fb6634f968793fae7e631291
5
5
  SHA512:
6
- metadata.gz: '09353285f8edabbc3677f6ba38f52d8a8532308dbf585db2e7119398d83193928963f7d792b0892905a5d14630b9d845a7359c300b8cdafc730ab96915310386'
7
- data.tar.gz: 04f42d8f430d5cab01d5c09839a0094dedc94ca176eb5c57cef041086ad7f4e30874235d93af068b2323f4df720546c7f5c10d7267de90846f5a68405fb40c29
6
+ metadata.gz: b0d3b0c745905aa0bb5ff214bbcc35586e9423e33805f8e3bdce47ad9c1481880db2d4cbebafeb2d9d949f8e65a35f40520380347d637ff5f3a4c8fbad91ed67
7
+ data.tar.gz: 52f8b3751a57ecd83a4137dcafa157ac875ae57f48a8f5b40f214789af41fd331ffd55cbe2edb274e8d0d33cad2bfc16e7fa3ea05c53ee67b1f1c696a80a4099
data/app/arguments.rb CHANGED
@@ -5,7 +5,7 @@ require "option_parser"
5
5
  watch: false,
6
6
  output: Dir.pwd,
7
7
  source: Dir.pwd,
8
- eslevel: "2021".to_i
8
+ eslevel: Config::get_eslevel
9
9
  }
10
10
 
11
11
  OptionParser.parse do |parser|
data/app/config.rb ADDED
@@ -0,0 +1,11 @@
1
+ module Config
2
+ module_function
3
+
4
+ @default = JsonParser.new File.join(ROOT, 'config/default.json')
5
+ # If eslevel doesn't already exist, the default value is used to initialize it.
6
+ @default.on :eslevel, "2021"
7
+
8
+ def get_eslevel
9
+ @default.parse(:eslevel).to_i
10
+ end
11
+ end
data/app/main.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "ruby_js"
2
+ require_relative "config"
2
3
  require_relative "arguments"
3
4
  require_relative "signals"
4
5
 
@@ -0,0 +1,10 @@
1
+ module Description
2
+ module_function
3
+
4
+ def get_readme(parag_count)
5
+ path_ra = File.expand_path("..", __dir__)
6
+ path_fa = File.join(path_ra, 'README.md')
7
+ content = File.open(path_fa).read.split("\n")[1..parag_count + 1]
8
+ content.join("\n")
9
+ end
10
+ end
data/lib/json_parser.rb CHANGED
@@ -11,7 +11,7 @@ class JsonParser
11
11
  end
12
12
 
13
13
  def on symbol, value
14
- if exist?
14
+ unless @db.include?(symbol.to_s)
15
15
  parse symbol, value
16
16
  end
17
17
  end
@@ -23,8 +23,12 @@ module RubyJS
23
23
  file.close
24
24
  end
25
25
 
26
- def self.free path_o
27
- File.delete(path_o) if File.exists? path_o
26
+ def self.free path_fro
27
+ # File
28
+ File.delete(path_fro) if File.exists? path_fro
29
+ # Dir
30
+ path_dro = File.dirname(path_fro)
31
+ Dir.delete(path_dro) if Dir.empty? path_dro
28
32
  end
29
33
 
30
34
  def self.event_p event, path_f
@@ -12,12 +12,12 @@ module RubyJS
12
12
  json_oc = JsonParser.new File.join(path_ao, "package.json")
13
13
  json_oc.parse :name, project.downcase
14
14
 
15
- change_server_f(path_ao)
15
+ change_watch_f(path_ao)
16
16
  install_vite(project, path_ao)
17
17
  end
18
18
 
19
- def self.change_server_f path_ao
20
- path_bin_ao = "#{path_ao}/bin/server"
19
+ def self.change_watch_f path_ao
20
+ path_bin_ao = "#{path_ao}/bin/watch"
21
21
  content = Helper.open(path_bin_ao)
22
22
  content_ch = content.sub("APP_NAME", Constants::APP_NAME)
23
23
  Helper.write(path_bin_ao, content_ch)
@@ -1,3 +1,3 @@
1
1
  module RubyJS
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -1,4 +1,4 @@
1
1
  #!/bin/bash
2
2
 
3
- APP_NAME -c -w -s src/rjs -o src/.js &
3
+ . $(pwd)/bin/watch &
4
4
  npm run dev
@@ -0,0 +1,3 @@
1
+ #!/bin/bash
2
+
3
+ APP_NAME -c -w -s src/rjs -o src/.js
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyjs-vite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filip Vrba
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-04 00:00:00.000000000 Z
11
+ date: 2022-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby2js
@@ -38,7 +38,8 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.7'
41
- description: 'To learn more, go to this page: https://github.com/filipvrba/ruby-js'
41
+ description: Using this translation tool, you can run Vite server and write code in
42
+ Ruby syntax using JS API. See GitHub for further information. |> https://github.com/filipvrba/ruby-js
42
43
  email: filipvrbaxi@gmail.com
43
44
  executables:
44
45
  - rjsv
@@ -46,9 +47,11 @@ extensions: []
46
47
  extra_rdoc_files: []
47
48
  files:
48
49
  - app/arguments.rb
50
+ - app/config.rb
49
51
  - app/main.rb
50
52
  - app/signals.rb
51
53
  - bin/rjsv
54
+ - lib/description.rb
52
55
  - lib/json_parser.rb
53
56
  - lib/option_parser.rb
54
57
  - lib/ruby_js.rb
@@ -57,6 +60,7 @@ files:
57
60
  - lib/ruby_js/scaffold.rb
58
61
  - lib/ruby_js/version.rb
59
62
  - share/template/bin/server
63
+ - share/template/bin/watch
60
64
  - share/template/index.html
61
65
  - share/template/package.json
62
66
  - share/template/public/vite.svg
@@ -82,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
86
  - !ruby/object:Gem::Version
83
87
  version: '0'
84
88
  requirements: []
85
- rubygems_version: 3.4.0.dev
89
+ rubygems_version: 3.3.7
86
90
  signing_key:
87
91
  specification_version: 4
88
92
  summary: Converts the syntax of ruby into javascript.