medea-generators 0.2.6 → 0.3.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.
@@ -0,0 +1,23 @@
1
+ Description:
2
+ Initialises the settings required to use JasonDB from your Rails application.
3
+ Also patches config/application.rb to remove the dependency on active record.
4
+ Topics created are:
5
+ <base>-dev # Used in the rails development environment
6
+ <base>-test # Used in the rails test environment
7
+ <base> # Used in the rails production environment
8
+
9
+ Usage:
10
+ Pass the name of your desired topic (JasonDB namespace), and a username and password.
11
+ Note that all three of these fields are optional and can be randomly generated for you.
12
+
13
+ Examples:
14
+ rails generate medea:init
15
+
16
+ Will initialise database.yml, add the JasonDB initialiser, patch application.rb,
17
+ generate a topic base, username and password and create the topic(s) on JasonDB.
18
+
19
+ rails generate medea:init myapp user_name p@$$w0rD
20
+
21
+ Will do the same as above, but will use 'myapp' as the topic base, 'user_name' as the
22
+ user name and 'p@$$w0rD' as the password in database.yml and when creating the topics
23
+ on JasonDB.
@@ -64,9 +64,9 @@ require 'rails/test_unit/railtie'
64
64
  end
65
65
 
66
66
  application_rb.close
67
- say_status "patched", "config/application.rb", :green
67
+ say_status "patch", "config/application.rb", :green
68
68
  else
69
- say_status "checked", "config/application.rb", :blue
69
+ say_status "check", "config/application.rb", :blue
70
70
  end
71
71
  end
72
72
 
@@ -100,12 +100,12 @@ require 'rails/test_unit/railtie'
100
100
  end
101
101
 
102
102
  if success
103
- say_status "create", "Topic created."
103
+ say_status "create", "JasonDB Topic: #{topic}"
104
104
  else
105
105
  if topic[0] =~ /[0-9]/
106
- say_status "Error", "An error occurred while creating the Topic. It must start with a letter", :red
106
+ say_status "error", "An error occurred while creating the Topic. It must start with a letter", :red
107
107
  else
108
- say_status "Warning", "An error occurred while creating the Topic. Does it already exist?", :yellow
108
+ say_status "warning", "An error occurred while creating the Topic. Does it already exist?", :yellow
109
109
  end
110
110
  end
111
111
 
@@ -4,9 +4,6 @@ Description:
4
4
  resource-oriented application. Tests or specs are also generated depending
5
5
  on if you have a "spec" directory or not.
6
6
 
7
- IMPORTANT: This generator uses the "title" helper method which is generated
8
- by the nifty_layout generator. You may want to run that generator first.
9
-
10
7
  Usage:
11
8
  Pass the name of the model, either CamelCased or under_scored, as the first
12
9
  argument along with an optional list of attribute pairs and controller actions.
@@ -1,4 +1,4 @@
1
- <%% title "Edit <%= singular_name.titleize %>" %>
1
+ <h1><%%= "Edit <%= singular_name.titleize %>" %></h1>
2
2
 
3
3
  <%= render_form %>
4
4
 
@@ -1,4 +1,4 @@
1
- <%% title "<%= plural_name.titleize %>" %>
1
+ <h1><%%= "<%= plural_name.titleize %>" %></h1>
2
2
 
3
3
  <table>
4
4
  <tr>
@@ -1,4 +1,4 @@
1
- <%% title "New <%= singular_name.titleize %>" %>
1
+ <h1><%%= "New <%= singular_name.titleize %>" %></h1>
2
2
 
3
3
  <%= render_form %>
4
4
 
@@ -1,4 +1,4 @@
1
- <%% title "<%= singular_name.titleize %>" %>
1
+ <h1><%%= "<%= singular_name.titleize %>" %></h1>
2
2
 
3
3
  <%- for attribute in model_attributes -%>
4
4
  <p>
@@ -1,4 +1,5 @@
1
- - title "Edit <%= singular_name.titleize %>"
1
+ %h1
2
+ = "Edit <%= singular_name.titleize %>"
2
3
 
3
4
  <%= render_form %>
4
5
 
@@ -1,4 +1,5 @@
1
- - title "<%= plural_name.titleize %>"
1
+ %h1
2
+ = "<%= plural_name.titleize %>"
2
3
 
3
4
  %table
4
5
  %tr
@@ -1,4 +1,5 @@
1
- - title "New <%= singular_name.titleize %>"
1
+ %h1
2
+ = "New <%= singular_name.titleize %>"
2
3
 
3
4
  <%= render_form %>
4
5
 
@@ -1,4 +1,5 @@
1
- - title "<%= singular_name.titleize %>"
1
+ %h1
2
+ = "<%= singular_name.titleize %>"
2
3
 
3
4
  <%- for attribute in model_attributes -%>
4
5
  %p
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "medea-generators"
6
- s.version = "0.2.6"
6
+ s.version = "0.3.0"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Michael Jensen"]
9
9
  s.email = ["michaelj@jasondb.com"]
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 2
8
- - 6
9
- version: 0.2.6
7
+ - 3
8
+ - 0
9
+ version: 0.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Jensen
@@ -76,6 +76,7 @@ files:
76
76
  - Gemfile.lock
77
77
  - Rakefile
78
78
  - lib/generators/medea.rb
79
+ - lib/generators/medea/init/USAGE
79
80
  - lib/generators/medea/init/init_generator.rb
80
81
  - lib/generators/medea/init/templates/database.yml
81
82
  - lib/generators/medea/init/templates/jasondb.rb