my_todo 1.0.3 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/ar_base.rb +7 -1
- data/lib/db/todos_test.sqlite3 +0 -0
- data/lib/my_todo/templates/config.yml.erb +3 -3
- data/lib/my_todo/version.rb +1 -1
- data/lib/setup.rb +9 -3
- data/my_todo.gemspec +9 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76a111465e17fce1d2f964cb77123c2f2497102d
|
4
|
+
data.tar.gz: 9e3e5bdba8b59aaf441e0964c89de22edffc5f38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
14
|
+
database: path,
|
9
15
|
pool: 5,
|
10
16
|
encoding: 'utf8'
|
11
17
|
)
|
data/lib/db/todos_test.sqlite3
CHANGED
Binary file
|
@@ -1,18 +1,18 @@
|
|
1
1
|
# To Run: rake db:migrate
|
2
2
|
development:
|
3
3
|
adapter: sqlite3
|
4
|
-
database: <%=
|
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: <%=
|
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: <%=
|
16
|
+
database: <%= HOME_DIR %>/.my_todo/data/todos_production.sqlite3
|
17
17
|
pool: 5
|
18
18
|
encoding: utf8
|
data/lib/my_todo/version.rb
CHANGED
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
|
13
|
+
desc 'db_config', 'Generate data file structure and configuration files'
|
12
14
|
def db_config
|
13
|
-
|
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",
|
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:
|
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-
|
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:
|