humdrum-rails 0.1.2 → 0.1.3
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 -1
- data/lib/humdrum/version.rb +1 -1
- data/lib/rails/generators/humdrum/layout/templates/views/bootstrap3/layouts/application/_header.html.erb +2 -1
- data/lib/rails/generators/humdrum/resource/templates/views/bootstrap3/resource/_field.html.erb +10 -1
- data/lib/rails/generators/humdrum/setup/templates/config/initializers/config_center.rb +21 -21
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9242fb27953d8bfac7bfd08b9b61c1094f45b5a8
|
4
|
+
data.tar.gz: 83594dc91fd20b7ae873683cb187d6caf38a82ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1816a162971d9f2ffc8e98f6156c4299a2e1704deab1fca0250b55ade434117aada6e555051a790840f8a1d84c6e1a43f9a4a6ea065c88c84470e38826c843d2
|
7
|
+
data.tar.gz: f34e2174e02c6b2e07c1d092ab06f8ec78324555056bff5007d606286f340e7609f25f75754ee1cc431630d2b56dbfa961c4d699f77931b9e5a9403057a81ea8
|
data/README.md
CHANGED
@@ -44,6 +44,8 @@ We will now see how humdrum can help us in setting up a project quickly.
|
|
44
44
|
|
45
45
|
$ rails g humdrum:setup --config-database --dbase_name=my_rails_app --db_username=kpvarma --password=password1234 --rbenv_gemsets=my_rails_app
|
46
46
|
|
47
|
+
rails g humdrum:setup
|
48
|
+
|
47
49
|
Type **Y** for all the questions and you will see something like this:
|
48
50
|
|
49
51
|
remove public/index.html
|
@@ -137,7 +139,15 @@ Take a browser and hit http://localhost:3000 and chekc out.
|
|
137
139
|
|
138
140
|
### STEP 5: Create a resource using humdrum
|
139
141
|
|
140
|
-
$ rails g humdrum:resource users/
|
142
|
+
$ rails g humdrum:resource users/document name:string --fluid --framework=bootstrap3
|
143
|
+
|
144
|
+
rails g humdrum:resource super_admin/admin name:string username:string status:string email:string phone:string address:string description:text password_digest:string auth_token:string --fluid --framework=bootstrap3
|
145
|
+
rails g humdrum:resource super_admin/trust name:string status:string email:string phone:string address:string description:text --fluid --framework=bootstrap3
|
146
|
+
|
147
|
+
rails g humdrum:resource admin/temple name:string description:text trust_id:integer --fluid --framework=bootstrap3
|
148
|
+
|
149
|
+
rails g humdrum:resource admin/deity name:string description:text temple_id:integer trust_id:integer --fluid --framework=bootstrap3
|
150
|
+
rails g humdrum:resource admin/offering name:string description:text temple_id:integer trust_id:integer --fluid --framework=bootstrap3
|
141
151
|
|
142
152
|
|
143
153
|
This will create layouts compatible with bootstrap3 for quick start. This will also create a welcome page (landing page) which is linked as root url in routes.rb.
|
data/lib/humdrum/version.rb
CHANGED
data/lib/rails/generators/humdrum/resource/templates/views/bootstrap3/resource/_field.html.erb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
place_holder = ""
|
7
7
|
end
|
8
8
|
inp_id = "inp_#{display_name.underscore.split(" ").join("_")}"
|
9
|
-
error_class = object.errors[field_name.to_s].any? ? "has-
|
9
|
+
error_class = object.errors[field_name.to_s].any? ? "has-error" : ""
|
10
10
|
%>
|
11
11
|
|
12
12
|
<div class="form-group <%%= error_class %>">
|
@@ -19,6 +19,9 @@
|
|
19
19
|
</label>
|
20
20
|
<div class="col-md-8">
|
21
21
|
<input name="<%%= object_name %>[<%%= field_name %>]" id="inp_<%%= display_name.underscore.split(" ").join("_") %>" class="text input form-control" type="<%%= input_type %>" placeholder="<%%= place_holder %>" value="<%%= object.send(field_name.to_s) %>" />
|
22
|
+
<% if object.errors[field_name.to_s].any? %>
|
23
|
+
<span for="inp_<%= display_name.underscore.split(" ").join("_") %>" class="help-block"><%= object.errors[field_name.to_s].first %></span>
|
24
|
+
<% end %>
|
22
25
|
</div>
|
23
26
|
|
24
27
|
<%% elsif input_type == "checkbox" %>
|
@@ -29,6 +32,9 @@
|
|
29
32
|
</label>
|
30
33
|
<div class="col-md-8">
|
31
34
|
<input name="<%%= object_name %>[<%%= field_name %>]" id="inp_<%%= display_name.underscore.split(" ").join("_") %>" type="<%%= input_type %>" class="checkbox input form-control" <%%= object.send(field_name.to_s) ? "checked='checked'" : "" %> />
|
35
|
+
<% if object.errors[field_name.to_s].any? %>
|
36
|
+
<span for="inp_<%= display_name.underscore.split(" ").join("_") %>" class="help-block"><%= object.errors[field_name.to_s].first %></span>
|
37
|
+
<% end %>
|
32
38
|
</div>
|
33
39
|
|
34
40
|
<%% elsif input_type == "textarea" %>
|
@@ -39,6 +45,9 @@
|
|
39
45
|
</label>
|
40
46
|
<div class="col-md-8">
|
41
47
|
<textarea name="<%%= object_name %>[<%%= field_name %>]" style="height:200px;" class="textarea input form-control" id="inp_<%%= display_name.underscore.split(" ").join("_") %> placeholder="<%%= place_holder %>" "><%%= object.send(field_name.to_s) %></textarea>
|
48
|
+
<% if object.errors[field_name.to_s].any? %>
|
49
|
+
<span for="inp_<%= display_name.underscore.split(" ").join("_") %>" class="help-block"><%= object.errors[field_name.to_s].first %></span>
|
50
|
+
<% end %>
|
42
51
|
</div>
|
43
52
|
|
44
53
|
<%% end %>
|
@@ -1,56 +1,56 @@
|
|
1
1
|
module ConfigCenter
|
2
|
-
|
2
|
+
|
3
3
|
module GeneralValidations
|
4
|
-
|
4
|
+
|
5
5
|
# xxxx@yyyy.zzz format
|
6
|
-
EMAIL_FORMAT_REG_EXP =
|
7
|
-
|
6
|
+
EMAIL_FORMAT_REG_EXP = /\A(|(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6})\z/i
|
7
|
+
|
8
8
|
# xxx-xxx-xxxx format
|
9
|
-
MOBILE_FORMAT_REG_EXP =
|
10
|
-
|
9
|
+
MOBILE_FORMAT_REG_EXP = /\A([0-9\(\)\/\+ \-]){3}-([0-9\(\)\/\+ \-]){3}-([0-9\(\)\/\+ \-]){4}\z/i
|
10
|
+
|
11
11
|
# xxx-xxx-xxxx format
|
12
|
-
PHONE_FORMAT_REG_EXP =
|
13
|
-
|
12
|
+
PHONE_FORMAT_REG_EXP = /\A([0-9\(\)\/\+ \-]){3}-([0-9\(\)\/\+ \-]){3}-([0-9\(\)\/\+ \-]){4}\z/i
|
13
|
+
|
14
14
|
# Generic Name
|
15
15
|
# a to z (both upper and lower case), 1 to 9, space and curly brackets "(" & ")" allowed.
|
16
16
|
NAME_MIN_LEN = 2
|
17
17
|
NAME_MAX_LEN = 56
|
18
|
-
NAME_FORMAT_REG_EXP =
|
18
|
+
NAME_FORMAT_REG_EXP = /\A[a-zA-Z1-9\-\ \(\)+]*\z/i
|
19
19
|
|
20
20
|
# User Name
|
21
21
|
# Minimum length is 6 by default and maximum length is 32 by default
|
22
22
|
# Only characters (both upper and lowercase), numbers, dot(.), underscore (_)
|
23
|
-
# No spaces, hyphen or any other special characters are allowed
|
23
|
+
# No spaces, hyphen or any other special characters are allowed
|
24
24
|
USERNAME_MIN_LEN = 6
|
25
25
|
USERNAME_MAX_LEN = 32
|
26
|
-
USERNAME_FORMAT_REG_EXP =
|
27
|
-
|
26
|
+
USERNAME_FORMAT_REG_EXP = /\A[a-zA-Z0-9\.\_+]*\z/i
|
27
|
+
|
28
28
|
# Password
|
29
29
|
# should have atleast 1 Character (a to z (both upper and lower case))
|
30
30
|
# and 1 Number (1 to 9)
|
31
31
|
# and 1 Special Character from (!,@,$,&,*,_)",
|
32
32
|
PASSWORD_MIN_LEN = 8
|
33
33
|
PASSWORD_MAX_LEN = 128
|
34
|
-
PASSWORD_FORMAT_REG_EXP =
|
35
|
-
|
34
|
+
PASSWORD_FORMAT_REG_EXP = /\A(?=.*?[a-z][A-Z])(?=.*?\d)(?=.*?[!@$&*_])\z/i
|
35
|
+
|
36
36
|
end
|
37
|
-
|
37
|
+
|
38
38
|
module Defaults
|
39
|
-
|
39
|
+
|
40
40
|
# the default number of milli seconds for which resource listing pages gets refreshed:
|
41
41
|
REFRESH_PAGE_IN_MILLI_SECONDS = 180000
|
42
|
-
|
42
|
+
|
43
43
|
# It will list 10 items per page unless user request to load more (this is done by passing 'per_page' in url)
|
44
44
|
ITEMS_PER_LIST = 10
|
45
|
-
# It will override the per_page to 10 (default val - ITEMS_PER_LIST), in case if the user request for more items to load in a single listing page.
|
45
|
+
# It will override the per_page to 10 (default val - ITEMS_PER_LIST), in case if the user request for more items to load in a single listing page.
|
46
46
|
# i.e if user passes per_page=251 (greater than MAX_ITEMS_PER_LIST), system will ignore it and fall back to default no of items to be listed in a page (ITEMS_PER_LIST)
|
47
47
|
MAX_ITEMS_PER_LIST = 250
|
48
|
-
|
48
|
+
|
49
49
|
# Other constans should follow here.
|
50
50
|
#SOME_XXX_PERIOD = 30.minutes
|
51
51
|
#SOME_YY = 30.minutes
|
52
|
-
|
53
|
-
##
|
52
|
+
|
53
|
+
##
|
54
54
|
def host
|
55
55
|
case Rails.env
|
56
56
|
when "development"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: humdrum-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krishnan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|