Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
120 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--color | ||
--warnings | ||
--require spec_helper | ||
--pattern "spec/*_spec.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
language: ruby | ||
|
||
bundler_args: --without development | ||
|
||
script: script/test | ||
gemfile: spec/support/rails_test_app/Gemfile | ||
|
||
rvm: | ||
- 2.1.0 | ||
- ruby-head | ||
- jruby-head | ||
- rbx | ||
|
||
- 2.3.8 | ||
- 2.4.7 | ||
- 2.5.6 | ||
- 2.6.4 | ||
gemfile: | ||
- gemfiles/5.2.gemfile | ||
- gemfiles/6.0.gemfile | ||
matrix: | ||
allow_failures: | ||
- rvm: 2.0.0 | ||
- rvm: ruby-head | ||
- rvm: jruby-head | ||
- rvm: rbx | ||
|
||
branches: | ||
only: | ||
- master | ||
exclude: | ||
- rvm: 2.3.8 | ||
gemfile: gemfiles/6.0.gemfile | ||
- rvm: 2.4.7 | ||
gemfile: gemfiles/6.0.gemfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
appraise '5.2' do | ||
gem 'rails', '~> 5.2.0' | ||
gem 'sqlite3' | ||
end | ||
|
||
appraise '6.0' do | ||
gem 'rails', '~> 6.0.0' | ||
gem 'sqlite3' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,8 @@ | ||
#!/usr/bin/env ruby | ||
lib = File.expand_path('../lib', __FILE__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
|
||
require_relative '../lib/zapata' | ||
require 'rubygems' | ||
require 'bundler/setup' | ||
require 'zapata' | ||
require 'zapata/cli' | ||
|
||
description_of_generate = "'zapata generate <filename>' | ||
-s, --single option to skip app/models analysis" | ||
|
||
slop = Slop.new(help: true, banner: true) do | ||
banner('Usage: zapata [options]') | ||
on :v, :version, 'Print version.' do | ||
puts "Your version is #{Zapata::VERSION}" | ||
end | ||
|
||
command('generate', description: description_of_generate) do | ||
on(:s, :single, "Does not analyze 'app/models'", banner: true) | ||
|
||
run do |opts, args| | ||
Zapata::Revolutionist.generate_with_friendly_output(args, opts) | ||
end | ||
end | ||
|
||
run do |opts, args| | ||
if args.present? | ||
Zapata::Revolutionist.generate_with_friendly_output(args, opts) | ||
end | ||
end | ||
end | ||
|
||
puts slop.help if ARGV.empty? | ||
slop.parse | ||
Zapata::CLI.start(ARGV) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "rails", "~> 5.2.0" | ||
gem "sqlite3" | ||
|
||
group :test do | ||
gem "coveralls", require: false | ||
end | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "rails", "~> 6.0.0" | ||
gem "sqlite3" | ||
|
||
group :test do | ||
gem "coveralls", require: false | ||
end | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'thor' | ||
require_relative 'version' | ||
|
||
module Zapata | ||
class CLI < Thor | ||
|
||
desc 'generate FILENAME', 'generate spec file for model' | ||
option :single, type: :boolean, desc: 'skip app/models analysis', aliases: :s | ||
def generate(filename) | ||
Zapata::Revolutionist.generate_with_friendly_output(filename: filename, single: options[:single]) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
require 'spec_helper' | ||
|
||
describe Zapata::Revolutionist do | ||
context 'it should work with' do | ||
it 'bare module' do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
require 'spec_helper' | ||
|
||
describe Zapata::Revolutionist do | ||
context 'it should work with' do | ||
it 'ints' do | ||
|
Oops, something went wrong.