opening_act 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53cdcad2b4e128867547442e613f83aec0815724
4
- data.tar.gz: 7ce35c11f8246eaa29188f77caf609699296639c
3
+ metadata.gz: 0d783f768ba97656f6ced7c890d503f8c93f816c
4
+ data.tar.gz: b14f23a6cda8fe36364241215f734bfc58350166
5
5
  SHA512:
6
- metadata.gz: b02b7322ad13caff65143c56b9d7e3e474e1de10f54d9ee3807e075a339c483a9153e69c4adfbda5a0126fd0bc129e1822211181e4388e24e796661c24f1e077
7
- data.tar.gz: a6df5b7bc0931e7b2c08f1df656868fecdc668db5355fb6d323822747917fa783186f0c072eb76ab4e1905e7b95956623a49ac452bdcbe3e2c79aa45206ed846
6
+ metadata.gz: ca1606615e06889b25399d0a6be7dae4e360550bfe9bbeac054940d95613c826756c7d9e6d2c08797c254d3cfa58f8aabfa3a5c6ee18e4ed1d9a011c7cf9c707
7
+ data.tar.gz: 92d7807243d93c0c42677a7ef11568dabff9bc2643276686b3ae9f7169a7a6ed3d5382034409939636656e029a0e26b643fb640365ce8a72cbc86ab6745bdb1b
@@ -22,7 +22,7 @@ module Outputable
22
22
  end
23
23
 
24
24
  def take_the_stage
25
- puts '> The Opening Act has begun to play. This may take a moment.'
25
+ puts '> The Opening Act has begun to perform. This may take a moment.'
26
26
  end
27
27
 
28
28
  def add_confirmation
@@ -39,9 +39,9 @@ module Outputable
39
39
  puts "> Your project has been renamed to '#{template.name}'."
40
40
  end
41
41
 
42
- def new_git_confirmation
43
- puts '> Running this command will initiate a git project.'
44
- puts "> Make sure you aren't running this inside another git project."
45
- puts '> Type QUIT if you wish to stop. Otherwise, click Enter.'
42
+ def nested_git_confirmation
43
+ puts '> A git project already exists in this directory.'
44
+ puts '> Running OpeningAct will create a nested git.'
45
+ puts '> Type CONTINUE if you wish to continue. Otherwise, press Enter.'
46
46
  end
47
47
  end
@@ -4,8 +4,8 @@ source "https://rubygems.org"
4
4
  gem 'sinatra'
5
5
  gem 'sinatra-contrib'
6
6
  gem 'erubis'
7
- gem 'rack'
8
- gem 'rspec'
7
+ gem 'rake'
8
+ gem 'dotenv'
9
9
 
10
10
  group :production do
11
11
  gem "puma"
@@ -15,3 +15,8 @@ group :development do
15
15
  gem 'pry'
16
16
  gem 'rubocop'
17
17
  end
18
+
19
+ group :test do
20
+ gem 'rspec', :require => 'spec'
21
+ gem 'rack-test'
22
+ end
@@ -4,7 +4,7 @@ source "https://rubygems.org"
4
4
  gem 'sinatra'
5
5
  gem 'sinatra-contrib'
6
6
  gem 'erubis'
7
- gem 'rack'
7
+ gem 'rake'
8
8
  gem 'minitest'
9
9
  gem 'minitest-reporters'
10
10
 
@@ -1,4 +1,3 @@
1
- require "bundler/gem_tasks"
2
1
  require "rake/testtask"
3
2
 
4
3
  Rake::TestTask.new(:test) do |t|
@@ -1,4 +1,4 @@
1
- require "#{File.dirname(__FILE__)}/spec_helper"
1
+ require_relative "#{File.dirname(__FILE__)}/spec_helper"
2
2
 
3
3
  describe 'main application' do
4
4
  include Rack::Test::Methods
@@ -1,6 +1,6 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
- Dir.glob(File.expand_path('../*.rb', __FILE__)).each do |file|
3
- require file
2
+ Dir.glob(File.expand_path('../../*.rb', __FILE__)).each do |file|
3
+ require_relative file
4
4
  end
5
5
 
6
6
  require 'minitest/autorun'
@@ -1,3 +1,3 @@
1
1
  class OpeningAct
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
data/lib/opening_act.rb CHANGED
@@ -12,7 +12,7 @@ class OpeningAct
12
12
  extend Verifiable
13
13
 
14
14
  def self.perform(name, test_name)
15
- return leave_the_stage unless play_on?
15
+ return leave_the_stage if nested_git? && quit_playing?
16
16
 
17
17
  setup(name, test_name)
18
18
  add_overwrite_rename_or_quit while directory_exists?
@@ -58,16 +58,20 @@ class OpeningAct
58
58
  test_type[0] == '-'
59
59
  end
60
60
 
61
+ def self.nested_git?
62
+ File.exists? '.git'
63
+ end
64
+
61
65
  def self.overwrite_existing_dir
62
66
  FileUtils.rm_rf(template.name)
63
67
 
64
68
  overwrite_confirmation
65
69
  end
66
70
 
67
- def self.play_on?
68
- new_git_confirmation
71
+ def self.quit_playing?
72
+ nested_git_confirmation
69
73
 
70
- !%w[quit q].include?(user_input.downcase)
74
+ user_input.downcase != 'continue'
71
75
  end
72
76
 
73
77
  def self.rename_project
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opening_act
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sun-Li Beatteay