my_todo 1.0.3 → 2.0.0

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: 11fb2e187ffec36175b7a00d524d44b08348e015
4
- data.tar.gz: def56ca74f0e9820e8478b2f85d16a92498db27d
3
+ metadata.gz: 76a111465e17fce1d2f964cb77123c2f2497102d
4
+ data.tar.gz: 9e3e5bdba8b59aaf441e0964c89de22edffc5f38
5
5
  SHA512:
6
- metadata.gz: 88b18aa11672994d46ac6a3f62070baf57dc0a188e60b44c470c2ba01525fa7ea1b876ed0c2af3dd9b5d41acddd20235106d8837fdf2bef09603813103f2ccb1
7
- data.tar.gz: dbe30f3a1a8bb02345f6128517f8e1deed00570d8744cc972654dd476dff71886e6997e82db7a4e181bae95d99e94e1943511923d25e1ab84182926c283c4ba1
6
+ metadata.gz: 8c47ce3d3f0d87c5930de8aae7e32996dbe2d0b2f0002001041b255dbbeed46e04046e87cefb16414895b8cf1eb0275c5a9a05962bb86fb034376c8c579c407f
7
+ data.tar.gz: ff1f261f50d0bd60f0d8c20d536cb2d0bc48a542c7c24a3b1220e2972440733350a7cafd7d8369536ae3d6ffa9fd4573c5ee0d2e3d4cb97f3b3c716fe961c6f9
data/README.md CHANGED
@@ -60,6 +60,17 @@ NOTE: In development, all commands must be run with the RAILS_ENV included. This
60
60
 
61
61
  Run `RAILS_ENV=test bin/my_todo rake db:migrate` to create the test db. Then run `rake` to run the RSpec tests.
62
62
 
63
+ ## Releasing
64
+ To release a new version,
65
+ * update the version number in `version.rb`
66
+ * tag the the code `git tag v1.0.0`
67
+ * push the tag `git push --tags`
68
+ * then run `bundle exec rake build`
69
+ * `gem push pkg/my_todo-verion`
70
+
71
+ ## Removing the gem
72
+ To remove the gem simply type `gem uninstall my_todo`. Along with this, you will need to remove `$HOME/.my_todo` to remove the database.
73
+
63
74
  ## Contributing
64
75
 
65
76
  Bug reports and pull requests are welcome on GitHub at https://github.com/vmcilwain/my_todo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
data/lib/ar_base.rb CHANGED
@@ -2,10 +2,16 @@
2
2
  #
3
3
  # Handles database connection
4
4
  module ArBase
5
+ # Set path based on bin/my_todo
6
+ path = if ENV['RAILS_ENV'] == 'test'
7
+ File.expand_path("../db/todos_test.sqlite3", __FILE__)
8
+ else
9
+ File.expand_path("#{`echo $HOME`.chomp}/.my_todo/data/todos_#{ENV['RAILS_ENV']}.sqlite3", __FILE__)
10
+ end
5
11
  # Connect to an sqlite3 database located in lib/db
6
12
  ActiveRecord::Base.establish_connection(
7
13
  adapter: 'sqlite3',
8
- database: File.expand_path("../db/todos_#{ENV['RAILS_ENV']}.sqlite3", __FILE__),
14
+ database: path,
9
15
  pool: 5,
10
16
  encoding: 'utf8'
11
17
  )
Binary file
@@ -1,18 +1,18 @@
1
1
  # To Run: rake db:migrate
2
2
  development:
3
3
  adapter: sqlite3
4
- database: <%= GEM_DIR %>/lib/db/todos_development.sqlite3
4
+ database: <%= HOME_DIR %>/.my_todo/data/todos_development.sqlite3
5
5
  pool: 5
6
6
  encoding: utf8
7
7
  # To Run: RAILS_ENV=test rake db:migrate
8
8
  test:
9
9
  adapter: sqlite3
10
- database: <%= GEM_DIR %>/lib/db/todos_test.sqlite3
10
+ database: <%= HOME_DIR %>/.my_todo/data/todos_test.sqlite3
11
11
  pool: 5
12
12
  encoding: utf8
13
13
  # To Run: RAILS_ENV=production rake db:migrate
14
14
  production:
15
15
  adapter: sqlite3
16
- database: <%= GEM_DIR %>/lib/db/todos_production.sqlite3
16
+ database: <%= HOME_DIR %>/.my_todo/data/todos_production.sqlite3
17
17
  pool: 5
18
18
  encoding: utf8
@@ -1,3 +1,3 @@
1
1
  module MyTodo
2
- VERSION = "1.0.3"
2
+ VERSION = "2.0.0"
3
3
  end
data/lib/setup.rb CHANGED
@@ -7,14 +7,20 @@ class Setup < Thor
7
7
  source_root "#{__dir__}/../lib/my_todo/templates"
8
8
  # Store the root of the gem directory
9
9
  GEM_DIR = "#{__dir__}/.."
10
+ # Store users home directory
11
+ HOME_DIR = `echo $HOME`.chomp
10
12
 
11
- desc 'db_config', 'Generate db configuration'
13
+ desc 'db_config', 'Generate data file structure and configuration files'
12
14
  def db_config
13
- template "config.yml.erb", "#{__dir__}/../lib/db/config.yml", {quiet: true, force: true}
15
+ unless File.exists?("#{HOME_DIR}/.my_todo/data")
16
+ `mkdir -p #{HOME_DIR}/.my_todo/data`
17
+ say "Created .my_todo in #{HOME_DIR}"
18
+ end
19
+ template "config.yml.erb", "#{__dir__}/../lib/db/config.yml", force: true
14
20
  end
15
21
 
16
22
  desc 'standard_migrations_override', 'Generate SM override file'
17
23
  def standard_migrations_override
18
- template "standalone_migrations.yml.erb", "#{__dir__}/../.standalone_migrations", {quiet: true, force: true}
24
+ template "standalone_migrations.yml.erb", "#{__dir__}/../.standalone_migrations", force: true
19
25
  end
20
26
  end
data/my_todo.gemspec CHANGED
@@ -36,4 +36,13 @@ Gem::Specification.new do |spec|
36
36
 
37
37
  spec.metadata["yard.run"] = "yri"
38
38
  spec.post_install_message = "Don't forget to migrate the db. `my_todo rake db:migrate`"
39
+
40
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
41
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
42
+ if spec.respond_to?(:metadata)
43
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
44
+ else
45
+ raise "RubyGems 2.0 or newer is required to protect against " \
46
+ "public gem pushes."
47
+ end
39
48
  end
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: 1.0.3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-30 00:00:00.000000000 Z
11
+ date: 2016-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -241,6 +241,7 @@ licenses:
241
241
  - MIT
242
242
  metadata:
243
243
  yard.run: yri
244
+ allowed_push_host: https://rubygems.org
244
245
  post_install_message: Don't forget to migrate the db. `my_todo rake db:migrate`
245
246
  rdoc_options: []
246
247
  require_paths: