rubyjs-vite 1.0.0 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f15333a2010c7a42765b915656d0040c0d120408eb3f7ce6ea0c498ac39cc000
4
- data.tar.gz: 07dd8234ee0d93c7f6fd6f1fa40d5e29eb2ef7097b29ad6e483472e5db680fd9
3
+ metadata.gz: 1d8be56a5cd62d9c0cc4751a44ea778fbee3dabead90381f28e3d8664c2266f3
4
+ data.tar.gz: d4af48e85e48a5deef17f59620e9a558930b463fc5b33338daeb04cdde15d5ee
5
5
  SHA512:
6
- metadata.gz: 62f535fbaa1312c1e81e695e8ec7a638b0e8e65ce1da78a908d4530697cf86345034af65da8f1ac25dad9cb8994365c84c29405331925147f61e272292cbc797
7
- data.tar.gz: 31e34aee73407d887d66f2fe7667e72f1b22be80f1d1b25a363eed4b44ed6683cb527e0225ee04d02a02330bbd84e50bae080c51583b6469fdacd9bfa8998b56
6
+ metadata.gz: ad86cf0733735f3cd6290881c9dff9b247459035801e46b82f8d1660f6bdb59c13a8b83b1027c6f14ee0358b8b9825dca646ee93cfe24c333100ab8f2a3f1de0
7
+ data.tar.gz: 63c92ff729d76d0ea5d55df1712e4731f06c944ecedd58e9723e71f1f26b7cccc00289932a87b2e8a1b0cd50fd16b67a45b0d1be3cc17e47784b4674d13afa48
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
@@ -12,20 +12,31 @@ 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)
24
24
  end
25
25
 
26
26
  def self.install_vite project, path_ao
27
- %x(cd #{path_ao} && npm install -D vite)
28
- puts "\nDone. Now run:\n\n cd #{project}\n bin/server\n\n"
27
+ is_done = system("cd #{path_ao} && npm install -D vite")
28
+ if is_done
29
+ puts "\nDone. Now run:\n\n cd #{project}\n bin/server\n\n"
30
+ else
31
+ wspaces = ' '*2
32
+ puts "\nThe Vite library installation encountered an issue.\n" +
33
+ "NodeJS is probably not installed on your machine.\n" +
34
+ "Please rerun the Vite installation after installing NodeJS.\n" +
35
+ "Use these instructions:\n\n" +
36
+ "#{wspaces}cd #{project}\n" +
37
+ "#{wspaces}npm install -D vite\n" +
38
+ "#{wspaces}bin/server"
39
+ end
29
40
  end
30
41
  end
31
42
  end
@@ -1,3 +1,3 @@
1
1
  module RubyJS
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.2"
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,16 +1,49 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyjs-vite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
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-02 00:00:00.000000000 Z
12
- dependencies: []
13
- description: ''
11
+ date: 2022-11-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ruby2js
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: listen
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.7'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.7'
41
+ description: |-
42
+ Web applications may be made with the help of RubyJS Vite. The programmer can avoid using JS syntax, which is helpful. Everything is done automatically; all you have to do is start the server and build a project using scaffolding.
43
+
44
+ Write your code using the JS api and Ruby syntax, and the server will automatically translate it. It then stores it in a file with the extension ".js". You will then be able to publish the project to [Vercel](https://vercel.com/) or directly to the [NPM package](https://www.npmjs.com/), and you will have a website that is written in the native JS language.
45
+
46
+ See GitHub for further information. |> https://github.com/filipvrba/ruby-js
14
47
  email: filipvrbaxi@gmail.com
15
48
  executables:
16
49
  - rjsv
@@ -18,9 +51,11 @@ extensions: []
18
51
  extra_rdoc_files: []
19
52
  files:
20
53
  - app/arguments.rb
54
+ - app/config.rb
21
55
  - app/main.rb
22
56
  - app/signals.rb
23
57
  - bin/rjsv
58
+ - lib/description.rb
24
59
  - lib/json_parser.rb
25
60
  - lib/option_parser.rb
26
61
  - lib/ruby_js.rb
@@ -29,6 +64,7 @@ files:
29
64
  - lib/ruby_js/scaffold.rb
30
65
  - lib/ruby_js/version.rb
31
66
  - share/template/bin/server
67
+ - share/template/bin/watch
32
68
  - share/template/index.html
33
69
  - share/template/package.json
34
70
  - share/template/public/vite.svg
@@ -54,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
90
  - !ruby/object:Gem::Version
55
91
  version: '0'
56
92
  requirements: []
57
- rubygems_version: 3.3.7
93
+ rubygems_version: 3.4.0.dev
58
94
  signing_key:
59
95
  specification_version: 4
60
96
  summary: Converts the syntax of ruby into javascript.