mindapp2 0.1.0 → 0.1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af8ccfc3585166109545d05c7b88ab21809ee893
4
- data.tar.gz: 56d7fef6cb4d9dc50ec3ff8166f71c91517722fc
3
+ metadata.gz: d846beee8f2a040e8ef4fdc26d10ebd243687653
4
+ data.tar.gz: 4a4b987cfa639a5ae48e8d8879b7e08d826d8442
5
5
  SHA512:
6
- metadata.gz: e594d47aa5797693d6bb386e50e0d6c985973f8dd11a5f18e8c1a4e7a3a6635d41f56d4b598c0bcc9d1305e617f4e47b4c25344eb2b407e50b819034afd17768
7
- data.tar.gz: 1cea12d01d5a4a3562e91274ba1b0d85832c42e3984408cf9d585fd00a44fd4c587aaad245eb4b6af38e6e2c04ba23fe3d02bcc91174776f7e65af454afbb5dd
6
+ metadata.gz: f1d8ee057f60fb0bc2c1f42a2a97153ef482f5ba2db4b548a2ff8172d1bdaf2f267982ca5d3ae37cb332bb8862bfe036bf7419a5326d1e6c7babf1e0502ba0a7
7
+ data.tar.gz: 933150ebe9b5700a31032648e58e849058899cb3b180fb9375e5f91df92430727f6aae2aa793a16448556832936c22e06d9b813e13f26f5be46333a214986a24
data/README.md CHANGED
@@ -1,43 +1,163 @@
1
- # Mindapp
1
+ # Mindapp2
2
+ ## v0.1.1.1
2
3
 
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/mindapp`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+ This is an extended version of Mindapp with mixed workflow and rails app. Mindapp2 maintain workflow feature with upgrade to most update ruby and rails.
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
6
+ ## Changelog
6
7
 
7
- ## Installation
8
+ * update for Rails 5.1.1
8
9
 
9
- Add this line to your application's Gemfile:
10
+ ## Prerequisites
10
11
 
11
- ```ruby
12
- gem 'mindapp'
13
- ```
12
+ These versions works for sure but others may do.
14
13
 
15
- And then execute:
14
+ * Ruby 2.4.1
15
+ * Rails 5.1.1
16
+ * MongoDB 6
17
+ * Freemind 1.0.1
18
+
19
+ ## Convention
20
+
21
+ * database is MongoDB
22
+ * images stored in upload directory, unset IMAGE_LOCATION in `initializer/mindapp.rb` to use Cloudinary
23
+ * mail use Gmail SMTP, config in `config/application.rb`
24
+ * authentication use omniauth-identity
25
+
26
+ ## Sample Application
27
+
28
+ Supposed we want to create ecommerce web site, first create a Rails
29
+ app without ActiveRecord
30
+
31
+ $ rails new shop --skip-test-unit --skip-bundle --skip-active-record
32
+
33
+ ## Add mindapp to your Gemfile:
34
+
35
+
36
+
37
+ For Development (most updated)
38
+ gem 'mindapp', github:'kul1/mindapp'
39
+
40
+ For Original
41
+ gem 'mindapp'
42
+
43
+
44
+ depend on your operating system, you may need to uncomment
45
+
46
+ gem 'therubyracer', :platforms => :ruby
47
+
48
+ install gems
16
49
 
17
50
  $ bundle
18
51
 
19
- Or install it yourself as:
52
+ generate mindapp application
20
53
 
21
- $ gem install mindapp
54
+ $ rails generate mindapp:install
22
55
 
23
- ## Usage
56
+ Then run bundle again to install additional gems added by mindapp
24
57
 
25
- TODO: Write usage instructions here
58
+ $ bundle
26
59
 
27
- ## Development
60
+ configure mongoid
28
61
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
62
+ $ rails generate mindapp:mongoid
30
63
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
64
+ Please make sure mongod is running then create admin user
32
65
 
33
- ## Contributing
66
+ $ rake mindapp:seed
67
+
68
+ now the application is ready, start it as any Rails application
69
+
70
+ $ rails server
71
+
72
+ go to http://localhost:3000, click *Sign In* on the left menu, and enter user name `admin` and password `secret`
73
+
74
+ ![home](https://cloud.githubusercontent.com/assets/3953832/25599624/deab1cee-2f07-11e7-8058-ef67a429e874.png)
75
+
76
+
77
+ Now open file `app/mindapp/index.mm` using Freemind
78
+
79
+ ![index mm](https://cloud.githubusercontent.com/assets/3953832/25599716/90ea1c84-2f08-11e7-8240-dac26742862d.png)
80
+
81
+ The 3 main branches are
82
+
83
+ * models - this defines all the models to use in the application
84
+ * services - this defines services which will be come the menu on the left of the screen. There will be 2 levels; the first sub branch is the main menu (modules) and the second sub branch is the sub menu (services)
85
+ * roles - this defines role for all users
86
+
87
+ ### models
88
+
89
+ Fiirst, we need to create some product so we click on models we'll see 2 models person and address. These are sample only. You can delete them or modify them however you want. We'll take a look at them first
90
+
91
+ ![image](https://cloud.githubusercontent.com/assets/3953832/25599768/139e95ba-2f09-11e7-98df-21b6caf9b664.png)
34
92
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/kul1/mindapp. 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.
93
+ The first sub branch (e.g. person) is the model name. According to Rails convention, this should be a singular word. The next sub branch are columns in the database. Let's take a look at each:
36
94
 
37
- ## License
95
+ * `fname` - this create a column (field) called fname which is a String by default
96
+ * `sex: integer` - this create a column called sex, it is integer so must be explicity defined. The next sub branch (1: male) is disregarded by Mindapp so we can put whatever we want. Here I just put some reminder.
97
+ * `belongs_to :address` - here we have ![pen](https://cloud.githubusercontent.com/assets/3953832/25600038/3a4ffb66-2f0b-11e7-9f03-b875e550eefe.png)
98
+ icon. this means whatever text on this line will be added as is to the model Mindapp generates. You use this to specify anything you want such as association, index, remarks in code, etc. according to mongoid gem. To draw the icon, rest mouse on the branch and hit &ltAlt-I&gt.
99
+ * `dob: date` - use any type that mongoid provides.
100
+ * `photo` - for file field, just use String here. Mindapp will receive the binary file and store in file system or cloudinary then generate a url link to it.
38
101
 
39
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
102
+ In this example we just want a product model, so delete the person and address model and add a product branch like so
40
103
 
41
- ## Code of Conduct
104
+ ![image](https://cloud.githubusercontent.com/assets/3953832/25599836/9bb82d58-2f09-11e7-9a26-c26a5d13c870.png)
105
+
106
+ Save the mind map then run:
107
+
108
+ rake mindapp:update
109
+
110
+ This will create file `app/models/product.rb`. In this file, note the comment lines `# mindapp begin` and ` # mindapp end`. Everything inside these comments will get overwritten when you change the models branch in the mind map so if you need to put anything inside here, use the mind map instead. You can add anything outside these comment lines which will be preserved when doing mindapp:update.
111
+
112
+ ### services
113
+
114
+ Next we'll add some product into the database, we'll first take a look at the services branch, which already has 3 sub branches; users, admins, and devs. Unlike models person and address branches, these branches are actively used by the system so I recommend that you leave them alone. Let's open the users branch
115
+
116
+ ![image](https://cloud.githubusercontent.com/assets/3953832/25599895/ecf46466-2f09-11e7-82aa-81ade6b9cd83.png)
117
+
118
+ The text `users:User` on the sub branch has these implications:
119
+
120
+ * `users` correspond to `app/controllers/users_controller.rb` which already exist when you do rails generate mindapp:install. New branch will create new controller if not exist. In Mindapp term, this will be called module.
121
+ * `User` will create entry in main menu on the left of the screen. You don't see it in the screenshot above because it's controlled by the sub branch `role:m` which means this menu only available for login member. If you already signed in as admin, you should see it now.
122
+
123
+ The next sub branches has the following:
124
+
125
+ * `role: m` - means that this module (menu) is available only to user who has role m (if you open the role branch now will see that role m is member). All registered user has role m by default. User who is not log on would not be able to access this module.
126
+ * `link:info: /users` - means that this is a link, the format is link: *submenu label* : *url* where submenu label is the text to show in the submenu and url is the link to go to, in this case, it woud go to http://localhost:3000/users which will perform index action of UsersController.
127
+ * `user:edit` the branch that do not start with role:, rule:, nor link: will be a Mindapp service. You will then specify the sequence of the execution as in this example there are 3 sub branches - enter_user, update_user, and rule:login? Let's take a look at them:
128
+
129
+ * `enter_user:edit` - the first step is to display a form to input user information, this is accompanied by icon ![image](https://cloud.githubusercontent.com/assets/3953832/25599946/47c32cf6-2f0a-11e7-80a8-2c02c6294c9a.png)
130
+ which means user interface screen. and will correspond to a view file `app/views/users/user/enter_user.html.erb` where `/users` comes from the module name (the sub branch of services), `/user` comes from the service name (the sub branch of users), and `enter_user.html.erb` comes from the first part of this branch. The `edit` after the colon is just a description of this step. This branch also has sub branch `rule:login? && own_xmain?` which specify rule for this step that the user must be login and can continue this task if he is the one who started it. *task* in here means each instance of service.
131
+ * `update_user` - this icon ![image](https://cloud.githubusercontent.com/assets/3953832/25599976/87b69ad2-2f0a-11e7-9aba-1bd4e9546d3e.png) means to execute method update_user within `users_controller.rb`
132
+
133
+ Armed with this knowledge, we are ready to add new product into our application like so:
134
+
135
+ ![add_enter](https://cloud.githubusercontent.com/assets/3953832/25600158/582d1fbe-2f0c-11e7-9bde-01a195a45b6c.png)
136
+
137
+
138
+ To generate controller and views we save this mind map and run
139
+
140
+ rake mindapp:update
141
+
142
+ open file `app/views/products/add/enter.html.erb` you'll see some sample view already in there but commented. edit the file so it look like this
143
+
144
+
145
+ ![product_enter](https://cloud.githubusercontent.com/assets/3953832/25600363/e5cc8282-2f0d-11e7-81f7-273c9bdc1a63.png)
146
+
147
+
148
+ Note that we do not specify form_tag and submit_tag, these will be supplied by Mindapp.
149
+
150
+ then open file `app/controllers/products_controller.rb` and add `create` method as follow. The method name has to be correspond to the ![bookmark](http://songrit.googlecode.com/files/bookmark.png) branch.
151
+
152
+ ![products_controller](http://songrit.googlecode.com/files/products_controller.png)
153
+
154
+
155
+ ... to be continued ...
156
+
157
+ ## Contributing
42
158
 
43
- Everyone interacting in the Mindapp project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kul1/mindapp/blob/master/CODE_OF_CONDUCT.md).
159
+ 1. Fork it
160
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
161
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
162
+ 4. Push to the branch (`git push origin my-new-feature`)
163
+ 5. Create new Pull Request
data/lib/mindapp2.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "mindapp2/version"
2
+ require 'mindapp2/railtie'
3
+
4
+ module Mindapp
5
+ # Your code goes here...
6
+ end
File without changes
@@ -1,5 +1,5 @@
1
- require 'mindapp'
2
- require 'mindapp/helpers'
1
+ require 'mindapp2'
2
+ require 'mindapp2/helpers'
3
3
 
4
4
  module Mindapp
5
5
  require 'rails'
@@ -0,0 +1,3 @@
1
+ module Mindapp
2
+ VERSION = "0.1.1.1"
3
+ end
@@ -1,5 +1,5 @@
1
- require 'mindapp'
2
- require 'mindapp/helpers'
1
+ require 'mindapp2'
2
+ require 'mindapp2/helpers'
3
3
  include Mindapp::Helpers
4
4
 
5
5
  @btext= "# mindapp begin"
@@ -1,12 +1,12 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "mindapp/version"
4
+ require "mindapp2/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "mindapp2"
8
8
  spec.version = Mindapp::VERSION
9
- spec.authors = ["Korakot Leemakdej"]
9
+ spec.authors = ["Korakot Leemakdej", "Prateep Kul"]
10
10
  spec.email = ["1.0@kul.asia"]
11
11
 
12
12
  spec.summary = %q{Rails workflow from mind map}
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mindapp2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Korakot Leemakdej
8
+ - Prateep Kul
8
9
  autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2017-07-04 00:00:00.000000000 Z
12
+ date: 2017-07-08 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
@@ -315,12 +316,12 @@ files:
315
316
  - lib/generators/mindapp/templates/spec/helpers/devs_helper_spec.rb
316
317
  - lib/generators/mindapp/templates/spec/helpers/users_helper_spec.rb
317
318
  - lib/generators/mindapp/templates/spec/spec_helper.rb
318
- - lib/mindapp.rb
319
- - lib/mindapp/helpers.rb
320
- - lib/mindapp/railtie.rb
321
- - lib/mindapp/version.rb
319
+ - lib/mindapp2.rb
320
+ - lib/mindapp2/helpers.rb
321
+ - lib/mindapp2/railtie.rb
322
+ - lib/mindapp2/version.rb
322
323
  - lib/tasks/mindapp.rake
323
- - mindapp.gemspec
324
+ - mindapp2.gemspec
324
325
  homepage: https://github.com/kul1/mindapp2
325
326
  licenses:
326
327
  - MIT
data/lib/mindapp.rb DELETED
@@ -1,6 +0,0 @@
1
- require "mindapp/version"
2
- require 'mindapp/railtie'
3
-
4
- module Mindapp
5
- # Your code goes here...
6
- end
@@ -1,3 +0,0 @@
1
- module Mindapp
2
- VERSION = "0.1.0"
3
- end