grape-cli-mongodb 1.0.1 → 1.0.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: f40b6b33ff25ba2965ed6f2fcde86846b76de7ba
4
- data.tar.gz: ea3c2774e479f3a49810b9a39d8b382b64d4ade4
3
+ metadata.gz: 0e44fb038c48daedabb81f591489bfa427b086cd
4
+ data.tar.gz: ced87d584fc63455747c45cc4fed501c8d1c79a5
5
5
  SHA512:
6
- metadata.gz: af651b91702eb5602a2613c39482cc3c8a5de7eea4c80c300901aaba0f14e39c98c528613e3016127fe5941b155e645ce67d605c24999f2c341b9bc5f7addfad
7
- data.tar.gz: d72189d3d928da70932833347009683ea83d3d76d3c39e99afd105319b4b7da8f7aab7cf5f23fa6964cbabbdcbe8a52a4f75f1b27be4553055dbbaa029a99676
6
+ metadata.gz: 4a9c87598bd5f827b1ceb4ab37ed02cfcfb46bbceb7d1cb61d3e2b87b1469834199f4b869ca090ca2e71a4033e2f2cfbb27fb6c23d4c7f4c2bec8f7d0b73e074
7
+ data.tar.gz: 79314a90a2ee5deb5a74577fc39ddf9f11256adc963c4a93d0ca437e2622b8d83346ce6268ed1ca52da29296d960a7cd5c537f08c0e1319dd35140d05cbbf68b
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Grape::Cli::Mongodb
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/grape/cli/mongodb`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Quickly bootstrap a working Grape API with MongoDB (you must have MongoDB installed, and have it running on localhost with the default port)
6
4
 
7
5
  ## Installation
8
6
 
@@ -14,7 +12,7 @@ gem 'grape-cli-mongodb'
14
12
 
15
13
  And then execute:
16
14
 
17
- $ bundle
15
+ $ bundle install
18
16
 
19
17
  Or install it yourself as:
20
18
 
@@ -22,7 +20,10 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ Quickly start a boilerplate Grape API with a MongoDB backend using the following command:
24
+
25
+ $ grape -n YOUR_PROJECT_NAME
26
+
26
27
 
27
28
  ## Development
28
29
 
@@ -32,10 +33,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
32
33
 
33
34
  ## Contributing
34
35
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/grape-cli-mongodb.
36
+ Bug reports and pull requests are welcome on GitHub at https://github.com/aronlmin/grape-cli-mongodb.
36
37
 
37
38
 
38
39
  ## License
39
40
 
40
41
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41
-
@@ -46,9 +46,11 @@ module Grape
46
46
 
47
47
  ## Copy the boilerplate directory to the filepath
48
48
  FileUtils.cp_r(boilerplate, filepath)
49
+ puts 'copied boilerplate directory to the working directory'
49
50
 
50
51
  ## rename the boilerplate directory to the project name
51
52
  FileUtils.mv( "#{filepath}/boilerplate", "#{filepath}/#{project}" )
53
+ puts 'renamed the boilerplate directory to the new project name'
52
54
 
53
55
  new_path = "#{filepath}/#{project}"
54
56
 
@@ -56,35 +58,34 @@ module Grape
56
58
  print '.'
57
59
  end
58
60
 
61
+
59
62
  file_names = ['/init.rb', '/config.ru', '/config/entities.rb']
60
63
  file_names.each do |file_name|
61
64
  text = File.read( File.join(new_path, file_name) )
62
65
  replace_module = text.gsub('BOILERPLATE', project.upcase.gsub('_', ''))
63
66
  File.open(File.join(new_path, file_name), 'w') { |file| file.puts replace_module }
64
- puts "created file ./#{file_name}"
67
+ puts "overwrote boilerplate for file #{file_name}"
65
68
  end
66
69
 
67
70
  config_files = ['/config/mongoid.yml']
68
71
  config_files.each do |file_name|
69
72
  text = File.read( File.join(new_path, file_name) )
70
- replace_db = text.gsub( 'boilerplate', project )
73
+ replace_db = text.gsub( 'boilerplate', project.downcase )
71
74
  File.open( File.join(new_path, file_name), 'w' ) { |file| file.puts replace_db }
72
- puts "created file ./#{file_name}"
75
+ puts "overwrote boilerplate for file #{file_name}"
73
76
  end
74
77
 
75
78
  folders_to_make = ['entities', 'lib', 'log', 'bin', 'models', 'resources', 'tasks']
76
79
  folders_to_make.each do |folder|
77
80
  Dir.mkdir( File.join(new_path, folder) )
78
- puts "created directory ./#{folder}"
81
+ puts "created directory #{folder}"
82
+ end
83
+
84
+ files_to_make = ['env.development']
85
+ files_to_make.each do |file|
86
+ File.new( File.join( new_path, file ), 'w' )
87
+ puts "created file #{file}"
79
88
  end
80
- ## create emty folders
81
- ## entities
82
- ## lib
83
- ## log
84
- ## bin
85
- ## models
86
- ## resources
87
- ## tasks
88
89
 
89
90
  end
90
91
 
@@ -1,7 +1,7 @@
1
1
  module Grape
2
2
  module Cli
3
3
  module Mongodb
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-cli-mongodb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ADL