my_todo 2.7.0 → 2.7.1

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: 7c77d8977ebdcd425114f1d5d6a263e9c2c87216
4
- data.tar.gz: 53755f1a2a23ce36b055e2f934794a89208477e0
3
+ metadata.gz: 6e34470c767f09895747115f0d3b3fe188711a7b
4
+ data.tar.gz: 88717583dab1f1967d68586652b825f844974090
5
5
  SHA512:
6
- metadata.gz: 2680c1b2174b5d952d3b86425a68fee467977cac7e7edebd56caff6165ed8d0e45daca3b781432536a161c34c476769040158887da72be36f8271fe829389b30
7
- data.tar.gz: e5ff8bf52834d32fd8b66c08a4e77f5def0669a5a507cda5d64555d66d762e9fcd71e74566b7d146f7ceef408bac6ccf66da0daaf11f244c9a3b67f910118b17
6
+ metadata.gz: 44541d49b304415df3d76122d684fbb0ecefb64beca23535aa17983de2f20eab057e2e4c8c71cebc6b7ce0c4d520a03e2a525b7919864ffb13579630dddff689
7
+ data.tar.gz: ce9a182b76a060e39fa323f35f3b47c38fc2dcb9c1a7a4f8d8c15f14ab58125de2b30c0b495cdcea176a7d58de6280d75f1b21232567dd112568691e461072df
data/Rakefile CHANGED
@@ -1,9 +1,12 @@
1
1
  require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
2
+
3
3
  require 'standalone_migrations'
4
4
 
5
5
  StandaloneMigrations::Tasks.load_tasks
6
6
 
7
- RSpec::Core::RakeTask.new(:spec)
7
+ unless ENV['RAILS_ENV'] == 'production'
8
+ require "rspec/core/rake_task"
9
+ RSpec::Core::RakeTask.new(:spec)
8
10
 
9
- task :default => :spec
11
+ task :default => :spec
12
+ end
Binary file
@@ -1,6 +1,6 @@
1
1
  # @author Lovell McIlwain
2
2
  # Handles running the todo application
3
- require File.expand_path('../../lib/my_todo/version', __FILE__)
3
+ require "#{__dir__}/my_todo/version"
4
4
  require 'thor'
5
5
  require 'erb'
6
6
  require 'sqlite3'
@@ -8,11 +8,11 @@ require 'active_record'
8
8
  require 'active_model'
9
9
  require 'yaml'
10
10
  require 'ransack'
11
- require_relative 'ar_base'
12
- require_relative 'item'
13
- require_relative 'stub'
14
- require_relative 'tag'
15
- require_relative 'note'
11
+ require_relative 'my_todo/ar_base'
12
+ require_relative 'my_todo/models/item'
13
+ require_relative 'my_todo/models/stub'
14
+ require_relative 'my_todo/models/tag'
15
+ require_relative 'my_todo/models/note'
16
16
 
17
17
  module MyTodo
18
18
  # Todo tasks using thor gem
@@ -23,7 +23,7 @@ module MyTodo
23
23
  # Private methods
24
24
  no_commands do
25
25
  def output(item)
26
- say ERB.new(File.read(File.expand_path("../../lib/my_todo/templates/output.erb", __FILE__)), nil, '-').result(binding)
26
+ say ERB.new(File.read("#{__dir__}/my_todo/templates/output.erb"), nil, '-').result(binding)
27
27
  end
28
28
 
29
29
  def item
@@ -3,11 +3,15 @@
3
3
  # Handles database connection
4
4
  module ArBase
5
5
  # Set path based on bin/my_todo
6
- path = if ENV['RAILS_ENV'] == 'test'
7
- File.expand_path("../db/todos_test.sqlite3", __FILE__)
6
+ path = case ENV['RAILS_ENV']
7
+ when 'development'
8
+ "#{__dir__}/../db/todos_development.sqlite3"
9
+ when 'test'
10
+ "#{__dir__}/../db/todos_test.sqlite3"
8
11
  else
9
- File.expand_path("#{`echo $HOME`.chomp}/.my_todo/data/todos_#{ENV['RAILS_ENV']}.sqlite3", __FILE__)
12
+ File.expand_path("#{`echo $HOME`.chomp}/.my_todo/data/todos_production.sqlite3", __FILE__)
10
13
  end
14
+
11
15
  # Connect to an sqlite3 database located in lib/db
12
16
  ActiveRecord::Base.establish_connection(
13
17
  adapter: 'sqlite3',
@@ -0,0 +1,7 @@
1
+ module MyTodo
2
+ class Configuration
3
+ def method_name
4
+
5
+ end
6
+ end
7
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,9 +1,9 @@
1
1
 
2
2
  ID: <%= item.id %> | Tags: <%= item.tags.map(&:name).join(', ') %> | Complete: <%= item.done %>
3
3
  <%= item.body %>
4
- <% if item.notes.any? %>
4
+ <% if item.notes.any? -%>
5
5
  Notes:
6
- <% item.notes.each do |note| %>
6
+ <% item.notes.each do |note| -%>
7
7
  <%= note.id %>: <%= note.body %>
8
8
  <% end %>
9
9
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module MyTodo
2
- VERSION = "2.7.0"
2
+ VERSION = "2.7.1"
3
3
  end
@@ -14,7 +14,7 @@ describe MyTodo do
14
14
  end
15
15
 
16
16
  it 'displays item with notes' do
17
- expect{MyTodo::Todo.start(%W[note --id=#{@todo.id} --body=note_text])}.to output("\nID: 1 | Tags: | Complete: \nSome Body\n\nNotes:\n\n1: note_text\n\n\n").to_stdout
17
+ expect{MyTodo::Todo.start(%W[note --id=#{@todo.id} --body=note_text])}.to output( "\nID: 1 | Tags: | Complete: \nSome Body\nNotes:\n1: note_text\n\n\n").to_stdout
18
18
  end
19
19
  end
20
20
 
@@ -21,7 +21,7 @@ describe MyTodo do
21
21
  end
22
22
 
23
23
  it 'finds todo items by associated notes content' do
24
- expect{MyTodo::Todo.start( %w[search note1])}.to output("ToDos FOUND: 1\n\nID: 3 | Tags: | Complete: \nalways\n\nNotes:\n\n1: note1\n\n\n").to_stdout
24
+ expect{MyTodo::Todo.start( %w[search note1])}.to output("ToDos FOUND: 1\n\nID: 3 | Tags: | Complete: \nalways\nNotes:\n1: note1\n\n\n").to_stdout
25
25
  end
26
26
  end
27
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_todo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-04 00:00:00.000000000 Z
11
+ date: 2016-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -238,7 +238,6 @@ files:
238
238
  - bin/console
239
239
  - bin/my_todo
240
240
  - bin/setup
241
- - lib/ar_base.rb
242
241
  - lib/db/config.yml
243
242
  - lib/db/migrate/20160912172429_create_items.rb
244
243
  - lib/db/migrate/20160913134552_create_tags.rb
@@ -247,16 +246,19 @@ files:
247
246
  - lib/db/schema.rb
248
247
  - lib/db/todos_development.sqlite3
249
248
  - lib/db/todos_test.sqlite3
250
- - lib/item.rb
251
249
  - lib/my_todo.rb
250
+ - lib/my_todo/ar_base.rb
251
+ - lib/my_todo/configuration.rb
252
+ - lib/my_todo/db/todos_test.sqlite3
253
+ - lib/my_todo/models/item.rb
254
+ - lib/my_todo/models/note.rb
255
+ - lib/my_todo/models/stub.rb
256
+ - lib/my_todo/models/tag.rb
252
257
  - lib/my_todo/templates/config.yml.erb
253
258
  - lib/my_todo/templates/output.erb
254
259
  - lib/my_todo/templates/standalone_migrations.yml.erb
255
260
  - lib/my_todo/version.rb
256
- - lib/note.rb
257
261
  - lib/setup.rb
258
- - lib/stub.rb
259
- - lib/tag.rb
260
262
  - my_todo.gemspec
261
263
  - spec/actions/create_spec.rb
262
264
  - spec/actions/delete_spec.rb