mta_json 0.0.1 → 0.0.2
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.
- data/README.md +17 -9
- data/examples/crud/README.md +13 -16
- data/examples/crud/meta.xml +0 -14
- data/lib/mta_json.rb +7 -6
- data/lib/mta_json/railtie.rb +12 -0
- data/lib/mta_json/version.rb +1 -1
- data/lib/mta_json/wrapper.rb +49 -22
- metadata +2 -133
- data/examples/crud/mta/crud/crud.lua +0 -0
- data/examples/crud/mta/crud/meta.xml +0 -3
- data/examples/crud/rails/.gitignore +0 -15
- data/examples/crud/rails/Gemfile +0 -40
- data/examples/crud/rails/Rakefile +0 -7
- data/examples/crud/rails/app/assets/images/rails.png +0 -0
- data/examples/crud/rails/app/assets/javascripts/application.js +0 -15
- data/examples/crud/rails/app/assets/javascripts/posts.js.coffee +0 -3
- data/examples/crud/rails/app/assets/stylesheets/application.css +0 -13
- data/examples/crud/rails/app/assets/stylesheets/posts.css.scss +0 -3
- data/examples/crud/rails/app/assets/stylesheets/scaffolds.css.scss +0 -69
- data/examples/crud/rails/app/controllers/application_controller.rb +0 -3
- data/examples/crud/rails/app/controllers/posts_controller.rb +0 -83
- data/examples/crud/rails/app/helpers/application_helper.rb +0 -2
- data/examples/crud/rails/app/helpers/posts_helper.rb +0 -2
- data/examples/crud/rails/app/mailers/.gitkeep +0 -0
- data/examples/crud/rails/app/models/.gitkeep +0 -0
- data/examples/crud/rails/app/models/post.rb +0 -3
- data/examples/crud/rails/app/views/layouts/application.html.erb +0 -14
- data/examples/crud/rails/app/views/posts/_form.html.erb +0 -25
- data/examples/crud/rails/app/views/posts/edit.html.erb +0 -6
- data/examples/crud/rails/app/views/posts/index.html.erb +0 -25
- data/examples/crud/rails/app/views/posts/new.html.erb +0 -5
- data/examples/crud/rails/app/views/posts/show.html.erb +0 -15
- data/examples/crud/rails/config.ru +0 -4
- data/examples/crud/rails/config/application.rb +0 -64
- data/examples/crud/rails/config/boot.rb +0 -6
- data/examples/crud/rails/config/database.yml +0 -25
- data/examples/crud/rails/config/environment.rb +0 -5
- data/examples/crud/rails/config/environments/development.rb +0 -37
- data/examples/crud/rails/config/environments/production.rb +0 -67
- data/examples/crud/rails/config/environments/test.rb +0 -37
- data/examples/crud/rails/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/crud/rails/config/initializers/inflections.rb +0 -15
- data/examples/crud/rails/config/initializers/mime_types.rb +0 -5
- data/examples/crud/rails/config/initializers/secret_token.rb +0 -7
- data/examples/crud/rails/config/initializers/session_store.rb +0 -8
- data/examples/crud/rails/config/initializers/wrap_parameters.rb +0 -14
- data/examples/crud/rails/config/locales/en.yml +0 -5
- data/examples/crud/rails/config/routes.rb +0 -61
- data/examples/crud/rails/db/migrate/20130320115007_create_posts.rb +0 -10
- data/examples/crud/rails/db/schema.rb +0 -23
- data/examples/crud/rails/db/seeds.rb +0 -7
- data/examples/crud/rails/lib/assets/.gitkeep +0 -0
- data/examples/crud/rails/lib/tasks/.gitkeep +0 -0
- data/examples/crud/rails/log/.gitkeep +0 -0
- data/examples/crud/rails/public/404.html +0 -26
- data/examples/crud/rails/public/422.html +0 -26
- data/examples/crud/rails/public/500.html +0 -25
- data/examples/crud/rails/public/favicon.ico +0 -0
- data/examples/crud/rails/public/index.html +0 -241
- data/examples/crud/rails/public/robots.txt +0 -5
- data/examples/crud/rails/script/rails +0 -6
- data/examples/crud/rails/test/fixtures/.gitkeep +0 -0
- data/examples/crud/rails/test/fixtures/posts.yml +0 -9
- data/examples/crud/rails/test/functional/.gitkeep +0 -0
- data/examples/crud/rails/test/functional/posts_controller_test.rb +0 -49
- data/examples/crud/rails/test/integration/.gitkeep +0 -0
- data/examples/crud/rails/test/performance/browsing_test.rb +0 -12
- data/examples/crud/rails/test/test_helper.rb +0 -13
- data/examples/crud/rails/test/unit/.gitkeep +0 -0
- data/examples/crud/rails/test/unit/helpers/posts_helper_test.rb +0 -4
- data/examples/crud/rails/test/unit/post_test.rb +0 -7
- data/examples/crud/rails/vendor/assets/javascripts/.gitkeep +0 -0
- data/examples/crud/rails/vendor/assets/stylesheets/.gitkeep +0 -0
- data/examples/crud/rails/vendor/plugins/.gitkeep +0 -0
data/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
Wraps MTA:SA's JSON format to support named parameters and different HTTP
|
|
4
4
|
methods with callRemote.
|
|
5
5
|
|
|
6
|
+
See [Multi Theft Auto: San Andreas](http://mtasa.com/).
|
|
7
|
+
|
|
6
8
|
## Installation
|
|
7
9
|
|
|
8
10
|
Add this line to your application's Gemfile:
|
|
@@ -17,11 +19,21 @@ Or install it yourself as:
|
|
|
17
19
|
|
|
18
20
|
$ gem install mta_json
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
## Configuration
|
|
23
|
+
|
|
24
|
+
### Whitelist for POST, PUT and DELETE
|
|
25
|
+
|
|
26
|
+
GET-requests are always processed.
|
|
27
|
+
|
|
28
|
+
POST-, PUT- and DELETE-requests are handled via an ip whitelist. The only
|
|
29
|
+
entry for this list is `127.0.0.1` per default.
|
|
30
|
+
It can be **overwritten** with the following code in your `application.rb`:
|
|
21
31
|
|
|
22
|
-
|
|
32
|
+
config.mta_json.whitelist = %w(1.2.3.4 1.2.3.5)
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
Or, to still allow requests from your local machine:
|
|
35
|
+
|
|
36
|
+
config.mta_json.whitelist = %w(1.2.3.4 1.2.3.5 127.0.0.1)
|
|
25
37
|
|
|
26
38
|
## Usage
|
|
27
39
|
|
|
@@ -122,9 +134,5 @@ A more complete example can be found in `examples/crud`.
|
|
|
122
134
|
|
|
123
135
|
## TODOs
|
|
124
136
|
|
|
125
|
-
*
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
<pre>skip_before_filter :verify_authenticity_token, :only => :your_method</pre>
|
|
129
|
-
|
|
130
|
-
* The code doesn't insert itself as middleware automatically, see Installation section.
|
|
137
|
+
* running rails behind a proxy/load balancer and IP resolution together with
|
|
138
|
+
the whitelist?
|
data/examples/crud/README.md
CHANGED
|
@@ -3,23 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
Tests whether you can create, read, update and delete posts from MTA
|
|
5
5
|
|
|
6
|
-
## Running the example
|
|
7
|
-
|
|
8
|
-
Start the rails server:
|
|
9
|
-
|
|
10
|
-
$ cd rails
|
|
11
|
-
$ rails s
|
|
12
|
-
|
|
13
|
-
Start the MTA Server and type the following commands:
|
|
14
|
-
|
|
15
|
-
$ aclrequest crud allow all
|
|
16
|
-
$ start crud
|
|
17
|
-
|
|
18
|
-
After that, the following commands are available within MTA (console, in-game)
|
|
19
|
-
|
|
20
|
-
* **/posts** - lists all posts
|
|
21
6
|
|
|
22
|
-
##
|
|
7
|
+
## Building a simple CRUD-based controller
|
|
23
8
|
|
|
24
9
|
Creating the project:
|
|
25
10
|
|
|
@@ -38,3 +23,15 @@ Generating a model Post along with a matching Controller:
|
|
|
38
23
|
Migrates the database to include the new posts table:
|
|
39
24
|
|
|
40
25
|
$ rake db:migrate
|
|
26
|
+
|
|
27
|
+
## Running the example
|
|
28
|
+
|
|
29
|
+
Start the rails server:
|
|
30
|
+
|
|
31
|
+
$ cd rails
|
|
32
|
+
$ rails s
|
|
33
|
+
|
|
34
|
+
Start the MTA Server and type the following commands:
|
|
35
|
+
|
|
36
|
+
$ aclrequest crud allow all
|
|
37
|
+
$ start crud
|
data/examples/crud/meta.xml
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
mta_json crud example to interact with rails.
|
|
3
|
-
|
|
4
|
-
See https://github.com/mabako/mta_json
|
|
5
|
-
-->
|
|
6
|
-
<meta>
|
|
7
|
-
<!-- Script source file -->
|
|
8
|
-
<script src="crud.lua"/>
|
|
9
|
-
|
|
10
|
-
<!-- This wouldn't make sense without callRemote, would it? -->
|
|
11
|
-
<aclrequest>
|
|
12
|
-
<right name="function.callRemote" access="true" />
|
|
13
|
-
</aclrequest>
|
|
14
|
-
</meta>
|
data/lib/mta_json.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
require "mta_json/version"
|
|
2
|
-
require "mta_json/wrapper"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
require "mta_json/version"
|
|
2
|
+
require "mta_json/wrapper"
|
|
3
|
+
require "mta_json/railtie" if defined? ::Rails::Railtie
|
|
4
|
+
|
|
5
|
+
module MtaJson
|
|
6
|
+
|
|
7
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module MtaJson
|
|
2
|
+
class Railtie < Rails::Railtie
|
|
3
|
+
config.mta_json = ActiveSupport::OrderedOptions.new
|
|
4
|
+
|
|
5
|
+
# default whitelist includes only the local ip.
|
|
6
|
+
config.mta_json.whitelist = %w(127.0.0.1)
|
|
7
|
+
|
|
8
|
+
initializer "mta_json.configure" do |app|
|
|
9
|
+
app.middleware.use MtaJson::Wrapper
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
data/lib/mta_json/version.rb
CHANGED
data/lib/mta_json/wrapper.rb
CHANGED
|
@@ -12,15 +12,19 @@ module MtaJson
|
|
|
12
12
|
BODY = 'rack.input'.freeze
|
|
13
13
|
FORM_INPUT = 'rack.request.form_input'.freeze
|
|
14
14
|
FORM_HASH = 'rack.request.form_hash'.freeze
|
|
15
|
+
SESSION = 'rack.session'.freeze
|
|
15
16
|
METHOD = 'REQUEST_METHOD'.freeze
|
|
16
17
|
POST = 'POST'.freeze
|
|
17
18
|
PATH_INFO = 'PATH_INFO'.freeze
|
|
19
|
+
IP = 'REMOTE_ADDR'.freeze
|
|
20
|
+
CSRF_TOKEN = 'X-CSRF-Token'.freeze
|
|
18
21
|
|
|
19
22
|
# HTTP-Response-Headers
|
|
20
23
|
CONTENT_LENGTH = 'Content-Length'.freeze
|
|
21
24
|
|
|
22
25
|
# Allowed Methods to be set by MTA
|
|
23
|
-
ALLOWED_METHODS = %w(
|
|
26
|
+
ALLOWED_METHODS = %w(GET)
|
|
27
|
+
ALLOWED_METHODS_PRIVATE = %w(POST PUT DELETE)
|
|
24
28
|
|
|
25
29
|
def initialize app
|
|
26
30
|
@app = app
|
|
@@ -65,9 +69,14 @@ module MtaJson
|
|
|
65
69
|
# optional options!
|
|
66
70
|
update_options env, json[1].with_indifferent_access if json.size >= 2
|
|
67
71
|
|
|
72
|
+
verify_request_method env
|
|
73
|
+
|
|
68
74
|
# any parameters given? otherwise we don't really care for any params
|
|
69
75
|
update_params env, json[0] if json.size >= 1 and json[0] != 0 # 0 is nil in terms of callRemote. JSON has 'null' though!
|
|
70
76
|
|
|
77
|
+
# add some CSRF info... maybe.
|
|
78
|
+
add_csrf_info env
|
|
79
|
+
|
|
71
80
|
# call the other middlewares
|
|
72
81
|
status, headers, response = @app.call(env)
|
|
73
82
|
|
|
@@ -91,30 +100,48 @@ module MtaJson
|
|
|
91
100
|
end
|
|
92
101
|
end
|
|
93
102
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
env
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
103
|
+
private
|
|
104
|
+
# update all of the parameter-related values in the current request's environment
|
|
105
|
+
def update_params env, json
|
|
106
|
+
env[FORM_HASH] = json
|
|
107
|
+
env[BODY] = env[FORM_INPUT] = StringIO.new(Rack::Utils.build_query(json))
|
|
108
|
+
end
|
|
100
109
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
# make sure the request came from a whitelisted ip, or uses a publically accessible request method
|
|
111
|
+
def verify_request_method env
|
|
112
|
+
allowed = ALLOWED_METHODS
|
|
113
|
+
allowed |= ALLOWED_METHODS_PRIVATE if whitelisted?(env)
|
|
114
|
+
if !allowed.include?(env[METHOD])
|
|
115
|
+
raise "Request method #{env[METHOD]} not allowed"
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# updates the options
|
|
120
|
+
def update_options env, options
|
|
121
|
+
if options[:method] and (ALLOWED_METHODS | ALLOWED_METHODS_PRIVATE).include?(options[:method])
|
|
122
|
+
# (possibly) TODO - pass parameters for GET instead of POST in update_params then?
|
|
123
|
+
# see https://github.com/rack/rack/blob/master/lib/rack/request.rb -> def GET
|
|
124
|
+
env[METHOD] = options[:method]
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# adds csrf info to non-GET requests of whitelisted IPs
|
|
129
|
+
def add_csrf_info env
|
|
130
|
+
env[CSRF_TOKEN] = env[SESSION][:_csrf_token] = SecureRandom.base64(32).to_s if env[METHOD] != 'GET' and whitelisted?(env)
|
|
108
131
|
end
|
|
109
|
-
end
|
|
110
132
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
133
|
+
# TODO might need to revise this behing proxies
|
|
134
|
+
def whitelisted? env
|
|
135
|
+
Railtie.config.mta_json.whitelist.include?(env[IP])
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# returns the response body: old response body + headers as a JSON array
|
|
139
|
+
def to_response response, headers
|
|
140
|
+
body = ""
|
|
141
|
+
response.each do |s|
|
|
142
|
+
body << s.to_s
|
|
143
|
+
end
|
|
144
|
+
["[#{body},#{headers.to_json.to_s}]"]
|
|
116
145
|
end
|
|
117
|
-
["[#{body},#{headers.to_json.to_s}]"]
|
|
118
146
|
end
|
|
119
|
-
end
|
|
120
147
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mta_json
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -59,73 +59,8 @@ files:
|
|
|
59
59
|
- examples/crud/README.md
|
|
60
60
|
- examples/crud/crud.lua
|
|
61
61
|
- examples/crud/meta.xml
|
|
62
|
-
- examples/crud/mta/crud/crud.lua
|
|
63
|
-
- examples/crud/mta/crud/meta.xml
|
|
64
|
-
- examples/crud/rails/.gitignore
|
|
65
|
-
- examples/crud/rails/Gemfile
|
|
66
|
-
- examples/crud/rails/Rakefile
|
|
67
|
-
- examples/crud/rails/app/assets/images/rails.png
|
|
68
|
-
- examples/crud/rails/app/assets/javascripts/application.js
|
|
69
|
-
- examples/crud/rails/app/assets/javascripts/posts.js.coffee
|
|
70
|
-
- examples/crud/rails/app/assets/stylesheets/application.css
|
|
71
|
-
- examples/crud/rails/app/assets/stylesheets/posts.css.scss
|
|
72
|
-
- examples/crud/rails/app/assets/stylesheets/scaffolds.css.scss
|
|
73
|
-
- examples/crud/rails/app/controllers/application_controller.rb
|
|
74
|
-
- examples/crud/rails/app/controllers/posts_controller.rb
|
|
75
|
-
- examples/crud/rails/app/helpers/application_helper.rb
|
|
76
|
-
- examples/crud/rails/app/helpers/posts_helper.rb
|
|
77
|
-
- examples/crud/rails/app/mailers/.gitkeep
|
|
78
|
-
- examples/crud/rails/app/models/.gitkeep
|
|
79
|
-
- examples/crud/rails/app/models/post.rb
|
|
80
|
-
- examples/crud/rails/app/views/layouts/application.html.erb
|
|
81
|
-
- examples/crud/rails/app/views/posts/_form.html.erb
|
|
82
|
-
- examples/crud/rails/app/views/posts/edit.html.erb
|
|
83
|
-
- examples/crud/rails/app/views/posts/index.html.erb
|
|
84
|
-
- examples/crud/rails/app/views/posts/new.html.erb
|
|
85
|
-
- examples/crud/rails/app/views/posts/show.html.erb
|
|
86
|
-
- examples/crud/rails/config.ru
|
|
87
|
-
- examples/crud/rails/config/application.rb
|
|
88
|
-
- examples/crud/rails/config/boot.rb
|
|
89
|
-
- examples/crud/rails/config/database.yml
|
|
90
|
-
- examples/crud/rails/config/environment.rb
|
|
91
|
-
- examples/crud/rails/config/environments/development.rb
|
|
92
|
-
- examples/crud/rails/config/environments/production.rb
|
|
93
|
-
- examples/crud/rails/config/environments/test.rb
|
|
94
|
-
- examples/crud/rails/config/initializers/backtrace_silencers.rb
|
|
95
|
-
- examples/crud/rails/config/initializers/inflections.rb
|
|
96
|
-
- examples/crud/rails/config/initializers/mime_types.rb
|
|
97
|
-
- examples/crud/rails/config/initializers/secret_token.rb
|
|
98
|
-
- examples/crud/rails/config/initializers/session_store.rb
|
|
99
|
-
- examples/crud/rails/config/initializers/wrap_parameters.rb
|
|
100
|
-
- examples/crud/rails/config/locales/en.yml
|
|
101
|
-
- examples/crud/rails/config/routes.rb
|
|
102
|
-
- examples/crud/rails/db/migrate/20130320115007_create_posts.rb
|
|
103
|
-
- examples/crud/rails/db/schema.rb
|
|
104
|
-
- examples/crud/rails/db/seeds.rb
|
|
105
|
-
- examples/crud/rails/lib/assets/.gitkeep
|
|
106
|
-
- examples/crud/rails/lib/tasks/.gitkeep
|
|
107
|
-
- examples/crud/rails/log/.gitkeep
|
|
108
|
-
- examples/crud/rails/public/404.html
|
|
109
|
-
- examples/crud/rails/public/422.html
|
|
110
|
-
- examples/crud/rails/public/500.html
|
|
111
|
-
- examples/crud/rails/public/favicon.ico
|
|
112
|
-
- examples/crud/rails/public/index.html
|
|
113
|
-
- examples/crud/rails/public/robots.txt
|
|
114
|
-
- examples/crud/rails/script/rails
|
|
115
|
-
- examples/crud/rails/test/fixtures/.gitkeep
|
|
116
|
-
- examples/crud/rails/test/fixtures/posts.yml
|
|
117
|
-
- examples/crud/rails/test/functional/.gitkeep
|
|
118
|
-
- examples/crud/rails/test/functional/posts_controller_test.rb
|
|
119
|
-
- examples/crud/rails/test/integration/.gitkeep
|
|
120
|
-
- examples/crud/rails/test/performance/browsing_test.rb
|
|
121
|
-
- examples/crud/rails/test/test_helper.rb
|
|
122
|
-
- examples/crud/rails/test/unit/.gitkeep
|
|
123
|
-
- examples/crud/rails/test/unit/helpers/posts_helper_test.rb
|
|
124
|
-
- examples/crud/rails/test/unit/post_test.rb
|
|
125
|
-
- examples/crud/rails/vendor/assets/javascripts/.gitkeep
|
|
126
|
-
- examples/crud/rails/vendor/assets/stylesheets/.gitkeep
|
|
127
|
-
- examples/crud/rails/vendor/plugins/.gitkeep
|
|
128
62
|
- lib/mta_json.rb
|
|
63
|
+
- lib/mta_json/railtie.rb
|
|
129
64
|
- lib/mta_json/version.rb
|
|
130
65
|
- lib/mta_json/wrapper.rb
|
|
131
66
|
- mta_json.gemspec
|
|
@@ -158,69 +93,3 @@ test_files:
|
|
|
158
93
|
- examples/crud/README.md
|
|
159
94
|
- examples/crud/crud.lua
|
|
160
95
|
- examples/crud/meta.xml
|
|
161
|
-
- examples/crud/mta/crud/crud.lua
|
|
162
|
-
- examples/crud/mta/crud/meta.xml
|
|
163
|
-
- examples/crud/rails/.gitignore
|
|
164
|
-
- examples/crud/rails/Gemfile
|
|
165
|
-
- examples/crud/rails/Rakefile
|
|
166
|
-
- examples/crud/rails/app/assets/images/rails.png
|
|
167
|
-
- examples/crud/rails/app/assets/javascripts/application.js
|
|
168
|
-
- examples/crud/rails/app/assets/javascripts/posts.js.coffee
|
|
169
|
-
- examples/crud/rails/app/assets/stylesheets/application.css
|
|
170
|
-
- examples/crud/rails/app/assets/stylesheets/posts.css.scss
|
|
171
|
-
- examples/crud/rails/app/assets/stylesheets/scaffolds.css.scss
|
|
172
|
-
- examples/crud/rails/app/controllers/application_controller.rb
|
|
173
|
-
- examples/crud/rails/app/controllers/posts_controller.rb
|
|
174
|
-
- examples/crud/rails/app/helpers/application_helper.rb
|
|
175
|
-
- examples/crud/rails/app/helpers/posts_helper.rb
|
|
176
|
-
- examples/crud/rails/app/mailers/.gitkeep
|
|
177
|
-
- examples/crud/rails/app/models/.gitkeep
|
|
178
|
-
- examples/crud/rails/app/models/post.rb
|
|
179
|
-
- examples/crud/rails/app/views/layouts/application.html.erb
|
|
180
|
-
- examples/crud/rails/app/views/posts/_form.html.erb
|
|
181
|
-
- examples/crud/rails/app/views/posts/edit.html.erb
|
|
182
|
-
- examples/crud/rails/app/views/posts/index.html.erb
|
|
183
|
-
- examples/crud/rails/app/views/posts/new.html.erb
|
|
184
|
-
- examples/crud/rails/app/views/posts/show.html.erb
|
|
185
|
-
- examples/crud/rails/config.ru
|
|
186
|
-
- examples/crud/rails/config/application.rb
|
|
187
|
-
- examples/crud/rails/config/boot.rb
|
|
188
|
-
- examples/crud/rails/config/database.yml
|
|
189
|
-
- examples/crud/rails/config/environment.rb
|
|
190
|
-
- examples/crud/rails/config/environments/development.rb
|
|
191
|
-
- examples/crud/rails/config/environments/production.rb
|
|
192
|
-
- examples/crud/rails/config/environments/test.rb
|
|
193
|
-
- examples/crud/rails/config/initializers/backtrace_silencers.rb
|
|
194
|
-
- examples/crud/rails/config/initializers/inflections.rb
|
|
195
|
-
- examples/crud/rails/config/initializers/mime_types.rb
|
|
196
|
-
- examples/crud/rails/config/initializers/secret_token.rb
|
|
197
|
-
- examples/crud/rails/config/initializers/session_store.rb
|
|
198
|
-
- examples/crud/rails/config/initializers/wrap_parameters.rb
|
|
199
|
-
- examples/crud/rails/config/locales/en.yml
|
|
200
|
-
- examples/crud/rails/config/routes.rb
|
|
201
|
-
- examples/crud/rails/db/migrate/20130320115007_create_posts.rb
|
|
202
|
-
- examples/crud/rails/db/schema.rb
|
|
203
|
-
- examples/crud/rails/db/seeds.rb
|
|
204
|
-
- examples/crud/rails/lib/assets/.gitkeep
|
|
205
|
-
- examples/crud/rails/lib/tasks/.gitkeep
|
|
206
|
-
- examples/crud/rails/log/.gitkeep
|
|
207
|
-
- examples/crud/rails/public/404.html
|
|
208
|
-
- examples/crud/rails/public/422.html
|
|
209
|
-
- examples/crud/rails/public/500.html
|
|
210
|
-
- examples/crud/rails/public/favicon.ico
|
|
211
|
-
- examples/crud/rails/public/index.html
|
|
212
|
-
- examples/crud/rails/public/robots.txt
|
|
213
|
-
- examples/crud/rails/script/rails
|
|
214
|
-
- examples/crud/rails/test/fixtures/.gitkeep
|
|
215
|
-
- examples/crud/rails/test/fixtures/posts.yml
|
|
216
|
-
- examples/crud/rails/test/functional/.gitkeep
|
|
217
|
-
- examples/crud/rails/test/functional/posts_controller_test.rb
|
|
218
|
-
- examples/crud/rails/test/integration/.gitkeep
|
|
219
|
-
- examples/crud/rails/test/performance/browsing_test.rb
|
|
220
|
-
- examples/crud/rails/test/test_helper.rb
|
|
221
|
-
- examples/crud/rails/test/unit/.gitkeep
|
|
222
|
-
- examples/crud/rails/test/unit/helpers/posts_helper_test.rb
|
|
223
|
-
- examples/crud/rails/test/unit/post_test.rb
|
|
224
|
-
- examples/crud/rails/vendor/assets/javascripts/.gitkeep
|
|
225
|
-
- examples/crud/rails/vendor/assets/stylesheets/.gitkeep
|
|
226
|
-
- examples/crud/rails/vendor/plugins/.gitkeep
|
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
|
2
|
-
#
|
|
3
|
-
# If you find yourself ignoring temporary files generated by your text editor
|
|
4
|
-
# or operating system, you probably want to add a global ignore instead:
|
|
5
|
-
# git config --global core.excludesfile ~/.gitignore_global
|
|
6
|
-
|
|
7
|
-
# Ignore bundler config
|
|
8
|
-
/.bundle
|
|
9
|
-
|
|
10
|
-
# Ignore the default SQLite database.
|
|
11
|
-
/db/*.sqlite3
|
|
12
|
-
|
|
13
|
-
# Ignore all logfiles and tempfiles.
|
|
14
|
-
/log/*.log
|
|
15
|
-
/tmp
|
data/examples/crud/rails/Gemfile
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
source 'https://rubygems.org'
|
|
2
|
-
|
|
3
|
-
gem 'rails', '3.2.12'
|
|
4
|
-
|
|
5
|
-
# Bundle edge Rails instead:
|
|
6
|
-
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
|
7
|
-
|
|
8
|
-
gem 'sqlite3'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Gems used only for assets and not required
|
|
12
|
-
# in production environments by default.
|
|
13
|
-
group :assets do
|
|
14
|
-
gem 'sass-rails', '~> 3.2.3'
|
|
15
|
-
gem 'coffee-rails', '~> 3.2.1'
|
|
16
|
-
|
|
17
|
-
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
|
18
|
-
# gem 'therubyracer', :platforms => :ruby
|
|
19
|
-
|
|
20
|
-
gem 'uglifier', '>= 1.0.3'
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
gem 'jquery-rails'
|
|
24
|
-
|
|
25
|
-
# To use ActiveModel has_secure_password
|
|
26
|
-
# gem 'bcrypt-ruby', '~> 3.0.0'
|
|
27
|
-
|
|
28
|
-
# To use Jbuilder templates for JSON
|
|
29
|
-
# gem 'jbuilder'
|
|
30
|
-
|
|
31
|
-
# Use unicorn as the app server
|
|
32
|
-
# gem 'unicorn'
|
|
33
|
-
|
|
34
|
-
# Deploy with Capistrano
|
|
35
|
-
# gem 'capistrano'
|
|
36
|
-
|
|
37
|
-
# To use debugger
|
|
38
|
-
# gem 'debugger'
|
|
39
|
-
|
|
40
|
-
gem 'mta_json'
|