apidoc_to_gfm 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +28 -0
- data/Rakefile +6 -0
- data/apidoc_to_gfm.gemspec +29 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/example/.gitignore +18 -0
- data/example/.rspec +2 -0
- data/example/Gemfile +13 -0
- data/example/Gemfile.lock +167 -0
- data/example/README.rdoc +28 -0
- data/example/Rakefile +6 -0
- data/example/app/assets/images/.keep +0 -0
- data/example/app/assets/javascripts/application.js +16 -0
- data/example/app/assets/stylesheets/application.css +15 -0
- data/example/app/controllers/application_controller.rb +5 -0
- data/example/app/controllers/concerns/.keep +0 -0
- data/example/app/controllers/orders_controller.rb +31 -0
- data/example/app/controllers/uploads_controller.rb +5 -0
- data/example/app/helpers/application_helper.rb +2 -0
- data/example/app/mailers/.keep +0 -0
- data/example/app/models/.keep +0 -0
- data/example/app/models/concerns/.keep +0 -0
- data/example/app/models/order.rb +2 -0
- data/example/app/views/layouts/application.html.erb +14 -0
- data/example/bin/bundle +3 -0
- data/example/bin/rails +8 -0
- data/example/bin/rake +8 -0
- data/example/bin/spring +18 -0
- data/example/config/application.rb +30 -0
- data/example/config/boot.rb +4 -0
- data/example/config/database.yml +25 -0
- data/example/config/environment.rb +5 -0
- data/example/config/environments/development.rb +37 -0
- data/example/config/environments/production.rb +83 -0
- data/example/config/environments/test.rb +39 -0
- data/example/config/initializers/backtrace_silencers.rb +7 -0
- data/example/config/initializers/cookies_serializer.rb +3 -0
- data/example/config/initializers/filter_parameter_logging.rb +4 -0
- data/example/config/initializers/inflections.rb +16 -0
- data/example/config/initializers/mime_types.rb +4 -0
- data/example/config/initializers/session_store.rb +3 -0
- data/example/config/initializers/wrap_parameters.rb +14 -0
- data/example/config/locales/en.yml +23 -0
- data/example/config/routes.rb +7 -0
- data/example/config/secrets.yml +22 -0
- data/example/config.ru +4 -0
- data/example/db/migrate/20140616151047_create_orders.rb +11 -0
- data/example/db/schema.rb +24 -0
- data/example/db/seeds.rb +7 -0
- data/example/lib/assets/.keep +0 -0
- data/example/lib/tasks/.keep +0 -0
- data/example/log/.keep +0 -0
- data/example/public/404.html +67 -0
- data/example/public/422.html +67 -0
- data/example/public/500.html +66 -0
- data/example/public/favicon.ico +0 -0
- data/example/public/robots.txt +5 -0
- data/example/spec/acceptance/orders_spec.rb +94 -0
- data/example/spec/acceptance/uploads_spec.rb +15 -0
- data/example/spec/acceptance_helper.rb +9 -0
- data/example/spec/fixtures/file.png +0 -0
- data/example/spec/rails_helper.rb +43 -0
- data/example/spec/spec_helper.rb +74 -0
- data/example/vendor/assets/javascripts/.keep +0 -0
- data/example/vendor/assets/stylesheets/.keep +0 -0
- data/lib/apidoc_to_gfm/version.rb +3 -0
- data/lib/apidoc_to_gfm/views/example.rb +42 -0
- data/lib/apidoc_to_gfm/views/helpers.rb +14 -0
- data/lib/apidoc_to_gfm/views/index.rb +17 -0
- data/lib/apidoc_to_gfm/views.rb +8 -0
- data/lib/apidoc_to_gfm/writers/writer.rb +13 -0
- data/lib/apidoc_to_gfm/writers.rb +6 -0
- data/lib/apidoc_to_gfm.rb +10 -0
- data/templates/rspec_api_documentation/gfm_example.mustache +34 -0
- data/templates/rspec_api_documentation/gfm_index.mustache +10 -0
- metadata +180 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MmRmNDcxNTRlNTMwZDhiNzMzODkwZmFjZDUxMGIxMWM3NjQ1ZDA4Mg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ODM3OWEzZWVkZWQ3ZDViYzk4NGQ4M2NmNjRhOWY5NGRiYzZhNzUwMw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YzM2YTBiMzFkMTc5NGZiNjExMjY5YmM0OWY2MTM2Y2JjNzY5ZTIyZDcwOTQ5
|
10
|
+
NzdlMThkOWY5YzI1MmFmYWUxNTJiYTYwOTE4YjBkODUzYzMwZTUyODljYTUw
|
11
|
+
ZDJiNmY2NDgzYjk0YWZmMmVjOWZmMWJiOGU1OWZlMDk2NGMxOTg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZTgxYzZmMjExNDY0NmU5ZjAwYzg0NjgzN2VlZTYyNzUyMGVmNmUxYmQ2NjVl
|
14
|
+
MWJjZjYyMDRiOThjZjNkYzYxOGZjYTc2MzJkNGJmNWNhMDY4MzU0ZTFmYWU0
|
15
|
+
MGQzNjJkMWNiOThhZDljYThhMmNiNzFlNmUwMDkyMzdjYzNmZDg=
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 German Antsiferov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# ApidocToGFM
|
2
|
+
|
3
|
+
ApidocToGFM is an template for [rspec_api_documentation](https://github.com/zipmark/rspec_api_documentation). The template supports [GitLab Flavored Markdown (GFM)](https://docs.gitlab.com/ee/user/markdown.html#gitlab-flavored-markdown-gfm).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'apidoc_to_gfm'
|
11
|
+
```
|
12
|
+
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
``` ruby
|
16
|
+
RspecApiDocumentation.configure do |config|
|
17
|
+
config.format = :gfm
|
18
|
+
end
|
19
|
+
```
|
20
|
+
|
21
|
+
## Contributing
|
22
|
+
|
23
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/mr-dxdy/apidoc_to_gfm.
|
24
|
+
|
25
|
+
|
26
|
+
## License
|
27
|
+
|
28
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'apidoc_to_gfm/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "apidoc_to_gfm"
|
8
|
+
spec.version = ApidocToGFM::VERSION
|
9
|
+
spec.authors = ["German Antsiferov"]
|
10
|
+
spec.email = ["dxdy@bk.ru"]
|
11
|
+
|
12
|
+
spec.summary = "An template for rspec_api_documentation"
|
13
|
+
spec.description = "The template supports GitLab Flavored Markdown (GFM)"
|
14
|
+
spec.homepage = "https://github.com/mr-dxdy/apidoc_to_gfm.git"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_dependency "rspec_api_documentation", ">= 4.7.0"
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.14"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
29
|
+
end
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "apidoc_to_gfm"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/example/.gitignore
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-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
|
+
/db/*.sqlite3-journal
|
13
|
+
|
14
|
+
# Ignore all logfiles and tempfiles.
|
15
|
+
/log/*.log
|
16
|
+
/tmp
|
17
|
+
|
18
|
+
doc
|
data/example/.rspec
ADDED
data/example/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rails', '4.2.8'
|
4
|
+
gem 'sqlite3'
|
5
|
+
gem 'spring', group: :development
|
6
|
+
gem 'raddocs', :github => "smartlogic/raddocs"
|
7
|
+
gem 'rails-i18n', '~> 4.0.0'
|
8
|
+
|
9
|
+
group :test, :development do
|
10
|
+
gem 'rspec-rails'
|
11
|
+
gem 'rspec_api_documentation', '4.7.0'
|
12
|
+
gem 'apidoc_to_gfm', :path => "../"
|
13
|
+
end
|
@@ -0,0 +1,167 @@
|
|
1
|
+
GIT
|
2
|
+
remote: git://github.com/smartlogic/raddocs.git
|
3
|
+
revision: 93d1c77bf4503607e95b21bcb84010e321616d90
|
4
|
+
specs:
|
5
|
+
raddocs (1.0.1)
|
6
|
+
haml (~> 4.0)
|
7
|
+
json (~> 1.8)
|
8
|
+
sinatra (~> 1.3)
|
9
|
+
|
10
|
+
PATH
|
11
|
+
remote: ..
|
12
|
+
specs:
|
13
|
+
apidoc_to_gfm (0.0.1)
|
14
|
+
rspec_api_documentation (>= 4.7.0)
|
15
|
+
|
16
|
+
GEM
|
17
|
+
remote: https://rubygems.org/
|
18
|
+
specs:
|
19
|
+
actionmailer (4.2.8)
|
20
|
+
actionpack (= 4.2.8)
|
21
|
+
actionview (= 4.2.8)
|
22
|
+
activejob (= 4.2.8)
|
23
|
+
mail (~> 2.5, >= 2.5.4)
|
24
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
25
|
+
actionpack (4.2.8)
|
26
|
+
actionview (= 4.2.8)
|
27
|
+
activesupport (= 4.2.8)
|
28
|
+
rack (~> 1.6)
|
29
|
+
rack-test (~> 0.6.2)
|
30
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
31
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
32
|
+
actionview (4.2.8)
|
33
|
+
activesupport (= 4.2.8)
|
34
|
+
builder (~> 3.1)
|
35
|
+
erubis (~> 2.7.0)
|
36
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
37
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
38
|
+
activejob (4.2.8)
|
39
|
+
activesupport (= 4.2.8)
|
40
|
+
globalid (>= 0.3.0)
|
41
|
+
activemodel (4.2.8)
|
42
|
+
activesupport (= 4.2.8)
|
43
|
+
builder (~> 3.1)
|
44
|
+
activerecord (4.2.8)
|
45
|
+
activemodel (= 4.2.8)
|
46
|
+
activesupport (= 4.2.8)
|
47
|
+
arel (~> 6.0)
|
48
|
+
activesupport (4.2.8)
|
49
|
+
i18n (~> 0.7)
|
50
|
+
minitest (~> 5.1)
|
51
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
52
|
+
tzinfo (~> 1.1)
|
53
|
+
arel (6.0.4)
|
54
|
+
builder (3.2.3)
|
55
|
+
concurrent-ruby (1.0.5)
|
56
|
+
diff-lcs (1.3)
|
57
|
+
erubis (2.7.0)
|
58
|
+
globalid (0.3.7)
|
59
|
+
activesupport (>= 4.1.0)
|
60
|
+
haml (4.0.7)
|
61
|
+
tilt
|
62
|
+
i18n (0.8.1)
|
63
|
+
json (1.8.6)
|
64
|
+
loofah (2.0.3)
|
65
|
+
nokogiri (>= 1.5.9)
|
66
|
+
mail (2.6.4)
|
67
|
+
mime-types (>= 1.16, < 4)
|
68
|
+
mime-types (2.99.3)
|
69
|
+
mini_portile2 (2.1.0)
|
70
|
+
minitest (5.10.1)
|
71
|
+
mustache (0.99.8)
|
72
|
+
nokogiri (1.6.8.1)
|
73
|
+
mini_portile2 (~> 2.1.0)
|
74
|
+
rack (1.6.5)
|
75
|
+
rack-protection (1.5.3)
|
76
|
+
rack
|
77
|
+
rack-test (0.6.3)
|
78
|
+
rack (>= 1.0)
|
79
|
+
rails (4.2.8)
|
80
|
+
actionmailer (= 4.2.8)
|
81
|
+
actionpack (= 4.2.8)
|
82
|
+
actionview (= 4.2.8)
|
83
|
+
activejob (= 4.2.8)
|
84
|
+
activemodel (= 4.2.8)
|
85
|
+
activerecord (= 4.2.8)
|
86
|
+
activesupport (= 4.2.8)
|
87
|
+
bundler (>= 1.3.0, < 2.0)
|
88
|
+
railties (= 4.2.8)
|
89
|
+
sprockets-rails
|
90
|
+
rails-deprecated_sanitizer (1.0.3)
|
91
|
+
activesupport (>= 4.2.0.alpha)
|
92
|
+
rails-dom-testing (1.0.8)
|
93
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
94
|
+
nokogiri (~> 1.6)
|
95
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
96
|
+
rails-html-sanitizer (1.0.3)
|
97
|
+
loofah (~> 2.0)
|
98
|
+
rails-i18n (4.0.9)
|
99
|
+
i18n (~> 0.7)
|
100
|
+
railties (~> 4.0)
|
101
|
+
railties (4.2.8)
|
102
|
+
actionpack (= 4.2.8)
|
103
|
+
activesupport (= 4.2.8)
|
104
|
+
rake (>= 0.8.7)
|
105
|
+
thor (>= 0.18.1, < 2.0)
|
106
|
+
rake (12.0.0)
|
107
|
+
rspec (3.5.0)
|
108
|
+
rspec-core (~> 3.5.0)
|
109
|
+
rspec-expectations (~> 3.5.0)
|
110
|
+
rspec-mocks (~> 3.5.0)
|
111
|
+
rspec-core (3.5.4)
|
112
|
+
rspec-support (~> 3.5.0)
|
113
|
+
rspec-expectations (3.5.0)
|
114
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
115
|
+
rspec-support (~> 3.5.0)
|
116
|
+
rspec-mocks (3.5.0)
|
117
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
118
|
+
rspec-support (~> 3.5.0)
|
119
|
+
rspec-rails (3.5.2)
|
120
|
+
actionpack (>= 3.0)
|
121
|
+
activesupport (>= 3.0)
|
122
|
+
railties (>= 3.0)
|
123
|
+
rspec-core (~> 3.5.0)
|
124
|
+
rspec-expectations (~> 3.5.0)
|
125
|
+
rspec-mocks (~> 3.5.0)
|
126
|
+
rspec-support (~> 3.5.0)
|
127
|
+
rspec-support (3.5.0)
|
128
|
+
rspec_api_documentation (4.7.0)
|
129
|
+
activesupport (>= 3.0.0)
|
130
|
+
json (~> 1.4, >= 1.4.6)
|
131
|
+
mustache (~> 0.99, >= 0.99.4)
|
132
|
+
rspec (>= 3.0.0)
|
133
|
+
sinatra (1.4.8)
|
134
|
+
rack (~> 1.5)
|
135
|
+
rack-protection (~> 1.4)
|
136
|
+
tilt (>= 1.3, < 3)
|
137
|
+
spring (2.0.1)
|
138
|
+
activesupport (>= 4.2)
|
139
|
+
sprockets (3.7.1)
|
140
|
+
concurrent-ruby (~> 1.0)
|
141
|
+
rack (> 1, < 3)
|
142
|
+
sprockets-rails (3.2.0)
|
143
|
+
actionpack (>= 4.0)
|
144
|
+
activesupport (>= 4.0)
|
145
|
+
sprockets (>= 3.0.0)
|
146
|
+
sqlite3 (1.3.13)
|
147
|
+
thor (0.19.4)
|
148
|
+
thread_safe (0.3.6)
|
149
|
+
tilt (2.0.7)
|
150
|
+
tzinfo (1.2.3)
|
151
|
+
thread_safe (~> 0.1)
|
152
|
+
|
153
|
+
PLATFORMS
|
154
|
+
ruby
|
155
|
+
|
156
|
+
DEPENDENCIES
|
157
|
+
apidoc_to_gfm!
|
158
|
+
raddocs!
|
159
|
+
rails (= 4.2.8)
|
160
|
+
rails-i18n (~> 4.0.0)
|
161
|
+
rspec-rails
|
162
|
+
rspec_api_documentation (= 4.7.0)
|
163
|
+
spring
|
164
|
+
sqlite3
|
165
|
+
|
166
|
+
BUNDLED WITH
|
167
|
+
1.14.6
|
data/example/README.rdoc
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
== README
|
2
|
+
|
3
|
+
This README would normally document whatever steps are necessary to get the
|
4
|
+
application up and running.
|
5
|
+
|
6
|
+
Things you may want to cover:
|
7
|
+
|
8
|
+
* Ruby version
|
9
|
+
|
10
|
+
* System dependencies
|
11
|
+
|
12
|
+
* Configuration
|
13
|
+
|
14
|
+
* Database creation
|
15
|
+
|
16
|
+
* Database initialization
|
17
|
+
|
18
|
+
* How to run the test suite
|
19
|
+
|
20
|
+
* Services (job queues, cache servers, search engines, etc.)
|
21
|
+
|
22
|
+
* Deployment instructions
|
23
|
+
|
24
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/example/Rakefile
ADDED
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require turbolinks
|
16
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
File without changes
|
@@ -0,0 +1,31 @@
|
|
1
|
+
class OrdersController < ApplicationController
|
2
|
+
def index
|
3
|
+
render :json => Order.all
|
4
|
+
end
|
5
|
+
|
6
|
+
def show
|
7
|
+
render :json => Order.find(params[:id])
|
8
|
+
end
|
9
|
+
|
10
|
+
def create
|
11
|
+
order = Order.create(order_params)
|
12
|
+
render :json => order, :status => 201, :location => order_url(order)
|
13
|
+
end
|
14
|
+
|
15
|
+
def update
|
16
|
+
order = Order.find(params[:id])
|
17
|
+
order.update(order_params)
|
18
|
+
render :nothing => true, :status => 204
|
19
|
+
end
|
20
|
+
|
21
|
+
def destroy
|
22
|
+
Order.find(params[:id]).destroy
|
23
|
+
head 204
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def order_params
|
29
|
+
params.require(:order).permit(:name, :paid, :email)
|
30
|
+
end
|
31
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Example</title>
|
5
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
6
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/example/bin/bundle
ADDED
data/example/bin/rails
ADDED
data/example/bin/rake
ADDED
data/example/bin/spring
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# This file loads spring without using Bundler, in order to be fast
|
4
|
+
# It gets overwritten when you run the `spring binstub` command
|
5
|
+
|
6
|
+
unless defined?(Spring)
|
7
|
+
require "rubygems"
|
8
|
+
require "bundler"
|
9
|
+
|
10
|
+
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
|
11
|
+
ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
|
12
|
+
ENV["GEM_HOME"] = ""
|
13
|
+
Gem.paths = ENV
|
14
|
+
|
15
|
+
gem "spring", match[1]
|
16
|
+
require "spring/binstub"
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
# Pick the frameworks you want:
|
4
|
+
require "active_model/railtie"
|
5
|
+
require "active_record/railtie"
|
6
|
+
require "action_controller/railtie"
|
7
|
+
require "action_mailer/railtie"
|
8
|
+
require "action_view/railtie"
|
9
|
+
require "sprockets/railtie"
|
10
|
+
# require "rails/test_unit/railtie"
|
11
|
+
|
12
|
+
# Require the gems listed in Gemfile, including any gems
|
13
|
+
# you've limited to :test, :development, or :production.
|
14
|
+
Bundler.require(*Rails.groups)
|
15
|
+
|
16
|
+
module Example
|
17
|
+
class Application < Rails::Application
|
18
|
+
# Settings in config/environments/* take precedence over those specified here.
|
19
|
+
# Application configuration should go into files in config/initializers
|
20
|
+
# -- all .rb files in that directory are automatically loaded.
|
21
|
+
|
22
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
23
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
24
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
25
|
+
|
26
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
27
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
28
|
+
config.i18n.default_locale = :ru
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
#
|
7
|
+
default: &default
|
8
|
+
adapter: sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
development:
|
13
|
+
<<: *default
|
14
|
+
database: db/development.sqlite3
|
15
|
+
|
16
|
+
# Warning: The database defined as "test" will be erased and
|
17
|
+
# re-generated from your development database when you run "rake".
|
18
|
+
# Do not set this db to the same as development or production.
|
19
|
+
test:
|
20
|
+
<<: *default
|
21
|
+
database: db/test.sqlite3
|
22
|
+
|
23
|
+
production:
|
24
|
+
<<: *default
|
25
|
+
database: db/production.sqlite3
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
|
+
|
12
|
+
# Show full error reports and disable caching.
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
|
16
|
+
# Don't care if the mailer can't send.
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
18
|
+
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
|
+
config.active_support.deprecation = :log
|
21
|
+
|
22
|
+
# Raise an error on page load if there are pending migrations.
|
23
|
+
config.active_record.migration_error = :page_load
|
24
|
+
|
25
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
26
|
+
# This option may cause significant delays in view rendering with a large
|
27
|
+
# number of complex assets.
|
28
|
+
config.assets.debug = true
|
29
|
+
|
30
|
+
# Adds additional error checking when serving assets at runtime.
|
31
|
+
# Checks for improperly declared sprockets dependencies.
|
32
|
+
# Raises helpful error messages.
|
33
|
+
config.assets.raise_runtime_errors = true
|
34
|
+
|
35
|
+
# Raises error for missing translations
|
36
|
+
# config.action_view.raise_on_missing_translations = true
|
37
|
+
end
|