cybertron 0.2.3 → 0.2.4

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: 7d249e6b5cdd8869a026fc544a5262942ca4cb75bbac9210558cce50d5dd057d
4
- data.tar.gz: d1aa8e5562a70dcb60d5d8ee7df257c6f6147e8e3f05df3517c640f06f88c70b
3
+ metadata.gz: c6b97b07cec13fe3e9ca75e59db7e0940598fc6d825633e8c908233f445f4574
4
+ data.tar.gz: 90383889d4fab83d32f6734d5936c4db28659e5099fd96f027c5fd1dc451f521
5
5
  SHA512:
6
- metadata.gz: 4f8701088ace779a2fc36d4fba7149d80fb0e37eb89df19fbaa5ad1fdef4b824449d5cb38701731d9cf7c4f3c0eb69e8561a3a0629f88d8be8affe47cdf65520
7
- data.tar.gz: 73a84addf2ef27033da229216d273956e3867962b8fe27374958a14e4ed3202ab3b868c6d212fb2c98215e6f2954a8e9e3f13e7b3de0b477c3910b44bbc18409
6
+ metadata.gz: 9979dd01c76a371273fcc7a2b6b8e12a508af70bbedb0b18a409f07c68a0cc8627925fd6977196e46ff4ea5020e2eb0e13a9ca22afdbc831953b07051fb4d7ce
7
+ data.tar.gz: 0a261619aa84a1982d59bb12b1f8cef938be233396ad2aca878a128c9013b2e94e85c8d66cf37ba18d07cd6a73899ce7a7f05a29209778f26f5aceb9632d0df0
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in cybertron.gemspec
4
4
  gemspec
5
+
6
+ gem 'coveralls', require: false
data/README.md CHANGED
@@ -1,10 +1,14 @@
1
1
  # cybertron
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/cybertron.svg)](https://badge.fury.io/rb/cybertron)
4
+ [![Build Status](https://travis-ci.org/rajasegar/cybertron.svg?branch=master)](https://travis-ci.org/rajasegar/cybertron)
5
+ ![](https://ruby-gem-downloads-badge.herokuapp.com/cybertron?type=total&style=plastic&color=brightgreen&total_label=)
6
+ [![Coverage Status](https://coveralls.io/repos/github/rajasegar/cybertron/badge.svg?branch=master)](https://coveralls.io/github/rajasegar/cybertron?branch=master)
7
+
4
8
 
5
9
  cybertron is a command line tool for generating, testing and publishing
6
10
  [converters](https://github.com/rajasegar/awesome-ruby-ast#converters) aka
7
- [Codemods](https://github.com/facebook/codemod) for Ruby.
11
+ [Codemods](https://github.com/facebook/codemod) for Ruby inspired by [codemod-cli](https://github.com/rwjblue/codemod-cli) for Javascript by [Robert Jackson](https://github.com/rwjblue)
8
12
 
9
13
  **INFO**:
10
14
  You can use a tool like [codeshift](https://github.com/rajasegar/codeshift) to run your codemods/transforms against your Ruby codebase.
@@ -12,20 +16,10 @@ For writing transforms you can also make use of the [Ruby AST Explorer](https://
12
16
 
13
17
  ## Installation
14
18
 
15
- Add this line to your application's Gemfile:
16
-
17
- ```ruby
18
- gem 'cybertron'
19
+ ```sh
20
+ $ gem install cybertron
19
21
  ```
20
22
 
21
- And then execute:
22
-
23
- $ bundle
24
-
25
- Or install it yourself as:
26
-
27
- $ gem install cybertron
28
-
29
23
  ## Usage
30
24
 
31
25
  ### Create a new codemod project
@@ -105,6 +99,30 @@ Rakefile
105
99
  ```
106
100
  $ cybertron spec
107
101
  ```
102
+ This will run all the specs in the spec folder, by comparing the input and output
103
+ fixtures against themselves for each and every transform.
104
+
105
+ ### Finding help or usage instructions
106
+ To display the help message and usage instructions, just invoke `cybertron`
107
+ without any arguments
108
+
109
+ ```sh
110
+ $ cybertron
111
+ ```
112
+
113
+ To display help about any particular command,
114
+ ```sh
115
+ $ cybertron help <command-name>
116
+ ```
117
+
118
+ For example, to know more about the `generate` command:
119
+ ```sh
120
+ $ cybertron help generate
121
+ ```
122
+
123
+ ## Other related tools
124
+ - [ruby-ast-explorer](https://github.com/rajasegar/ruby-ast-explorer)
125
+ - [codeshift](https://github.com/rajasegar/codeshift)
108
126
 
109
127
  ## Development
110
128
 
data/lib/cybertron/cli.rb CHANGED
@@ -31,10 +31,13 @@ module Cybertron
31
31
  puts "Creating new project: #{name}"
32
32
  FileUtils.mkdir_p "#{name}/transforms"
33
33
  FileUtils.mkdir_p "#{name}/spec"
34
- template 'rspec.tt', "#{name}/.rspec"
35
- template 'spec_helper.tt', "#{name}/spec/spec_helper.rb"
36
- template 'Rakefile.tt', "#{name}/Rakefile"
37
- template 'README.tt', "#{name}/README.md"
34
+ template 'rspec.tt', File.absolute_path("#{name}/.rspec")
35
+ template 'spec_helper.tt',
36
+ File.absolute_path("#{name}/spec/spec_helper.rb")
37
+ template 'Rakefile.tt',
38
+ File.absolute_path("#{name}/Rakefile")
39
+ template 'README.tt',
40
+ File.absolute_path("#{name}/README.md")
38
41
  end
39
42
 
40
43
  desc 'generate', 'Generate fixtures and transforms'
@@ -26,11 +26,11 @@ module Cybertron
26
26
  puts "Creating new transform: #{name}"
27
27
  FileUtils.mkdir_p "transforms/#{name}"
28
28
  FileUtils.mkdir_p "transforms/#{name}/fixtures"
29
- template 'transforms/transform.tt', "transforms/#{name}/transform.rb"
30
- template 'transforms/spec.tt', "spec/#{name}_spec.rb"
31
- template 'transforms/fixture_input.tt', "transforms/#{name}/fixtures/basic_input.rb"
32
- template 'transforms/fixture_output.tt', "transforms/#{name}/fixtures/basic_output.rb"
33
- template 'transforms/README.tt', "transforms/#{name}/README.md"
29
+ template 'transforms/transform.tt', File.absolute_path("transforms/#{name}/transform.rb")
30
+ template 'transforms/spec.tt', File.absolute_path("spec/#{name}_spec.rb")
31
+ template 'transforms/fixture_input.tt', File.absolute_path("transforms/#{name}/fixtures/basic_input.rb")
32
+ template 'transforms/fixture_output.tt', File.absolute_path("transforms/#{name}/fixtures/basic_output.rb")
33
+ template 'transforms/README.tt', File.absolute_path("transforms/#{name}/README.md")
34
34
  end
35
35
 
36
36
  desc 'fixture <transform-name> <fixture-name>', 'Generate a new fixture for a transform'
@@ -38,8 +38,8 @@ module Cybertron
38
38
  @codemod = codemod
39
39
  @name = name
40
40
  puts "Creating new fixture: #{name} for #{codemod}"
41
- template 'transforms/fixture_input.tt', "transforms/#{codemod}/fixtures/#{name}_input.rb"
42
- template 'transforms/fixture_output.tt', "transforms/#{codemod}/fixtures/#{name}_output.rb"
41
+ template 'transforms/fixture_input.tt', File.absolute_path("transforms/#{codemod}/fixtures/#{name}_input.rb")
42
+ template 'transforms/fixture_output.tt', File.absolute_path("transforms/#{codemod}/fixtures/#{name}_output.rb")
43
43
  end
44
44
 
45
45
 
@@ -1,3 +1,3 @@
1
1
  module Cybertron
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cybertron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajasegar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-20 00:00:00.000000000 Z
11
+ date: 2019-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -106,8 +106,8 @@ files:
106
106
  - lib/cybertron/generate_command.rb
107
107
  - lib/cybertron/options.rb
108
108
  - lib/cybertron/version.rb
109
+ - lib/templates/README.tt
109
110
  - lib/templates/Rakefile.tt
110
- - lib/templates/readme.tt
111
111
  - lib/templates/rspec.tt
112
112
  - lib/templates/spec_helper.tt
113
113
  - lib/templates/transforms/README.tt