Ryuta Kamizono
c81af6ae72
Enable Layout/EmptyLinesAroundAccessModifier
cop
...
We sometimes say "✂️ newline after `private`" in a code review (e.g.
https://github.com/rails/rails/pull/18546#discussion_r23188776 ,
https://github.com/rails/rails/pull/34832#discussion_r244847195 ).
Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style
`EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059 ).
That cop and enforced style will reduce the our code review cost.
2019-06-13 12:00:45 +09:00
M. Saiqul Haq
75aeac9fdf
[ci skip] Fix guides to link to edgeapi if on EDGE env
2019-04-01 12:47:34 +07:00
localhostdotdev
d4710fc538
Fix rails guides generation
...
Was getting `formats=': Invalid formats: "html"
2019-03-22 18:45:22 +01:00
Vipul A M
bb8fe3701a
After https://github.com/rails/rails/pull/35281 and https://github.com/rails/rails/pull/35036 AV warns about not having the compiled container.
...
Use the suggested with_empty_template_cache to overcome warning
2019-03-12 16:22:22 +05:30
Aaron Patterson
e17fe52e0e
Tighten up the AV::Base constructor
...
The AV::Base constructor was too complicated, and this commit tightens
up the parameters it will take. At runtime, AV::Base is most commonly
constructed here:
94d54fa4ab/actionview/lib/action_view/rendering.rb (L72-L74)
This provides an AV::Renderer instance, a hash of assignments, and a
controller instance. Since this is the common case for construction, we
should remove logic from the constructor that handles other cases. This
commit introduces special constructors for those other cases.
Interestingly, most code paths that construct AV::Base "strangely" are
tests.
2019-01-29 15:49:40 -08:00
Ryuta Kamizono
ea65d92f19
Enable Lint/UselessAssignment
cop to avoid unused variable warnings ( #34904 )
...
* Enable `Lint/UselessAssignment` cop to avoid unused variable warnings
Since we've addressed the warning "assigned but unused variable"
frequently.
370537de05092aeea552146b42042833212a1acc
3040446cece8e7a6d9e29219e636e13f180a1e03
5ed618e192e9788094bd92c51255dda1c4fd0eae
76ebafe594fc23abc3764acc7a3758ca473799e5
And also, I've found the unused args in c1b14ad which raises no warnings
by the cop, it shows the value of the cop.
2019-01-09 18:09:01 +09:00
toshimaru
4b56d60fe7
Add OG tags to layout.html.erb
2019-01-09 13:23:22 +09:00
Yosuke Kabuto
cb343ef672
Use safe nav operator when calling RailsGuides::Generator.new
...
Use String for direction of RailsGuides::Generator
2018-12-05 12:41:07 +09:00
Alberto Almagro
5020c2e302
Use direction instead of rtl flag.
...
Improve readability by using `direction` as CSS does.
More info: https://developer.mozilla.org/en-US/docs/Web/CSS/direction
Continues: #34486
[Alberto Almagro + Ufuk Kayserilioglu]
2018-11-22 22:39:13 +01:00
Rafael Mendonça França
c4720a25ed
Merge pull request #34486 from tamarr/master
...
allow right to left styling of docs
2018-11-19 13:20:08 -05:00
tamarr
29e0ed13f5
allow right to left styling of docs ( #3 )
...
* adding rtl css main file and logic to use
2018-11-19 18:59:52 +02:00
bogdanvlviv
b5b55fbde8
Wrap custom id of a header attribute into \" in rails guides
...
Related to https://github.com/rails/rails/pull/33953
2018-10-05 00:57:32 +03:00
wagurano
f92a8bfb94
Fix rails guides markdown.rb and renderer.rb to use custom header id
2018-09-23 19:57:36 +09:00
Ryuta Kamizono
b2c1e29c14
Enable Style/ParenthesesAroundCondition cop
...
To prevent style check in review like https://github.com/rails/rails/pull/33608#discussion_r211087605 .
2018-08-19 08:16:21 +09:00
Bart de Water
eb5fea40a4
Enable Start/EndWith and RegexpMatch cops
...
In cases where the MatchData object is not used, this provides a speed-up:
https://github.com/JuanitoFatas/fast-ruby/#stringmatch-vs-stringmatch-vs-stringstart_withstringend_with-code-start-code-end
2018-07-28 17:37:17 -04:00
Prathamesh Sonpatki
ecb6ee5948
Cleanup credits related code as it is removed now in PR #32429
2018-04-03 15:19:57 +05:30
Yoshiyuki Hirano
f8d346f9fd
Not generate needless files in guides
...
Not generate needless files:
* _license.html.erb, _welcome.html.erb are partial files.
* layout.html.erb is the layout file.
2018-04-02 18:30:23 +09:00
utilum
6f6fe69ea8
We should call methods with .method_name
not ::method_name
.
...
Found several instances.
Follow up on 63d530c5e68a8cf53603744789f53ccbc7ac1a0e
2018-02-22 00:54:40 +01:00
Fatos Morina
37cf9b3466
Fix typos and add a few suggestions
2017-11-28 19:27:43 +01:00
Ryuta Kamizono
146b1c2e33
Enable Style/RedundantReturn
rubocop rule, and fixed a couple more
...
Follow up of #31004 .
2017-11-01 07:32:04 +09:00
Koichi ITO
1f37d846a9
Use frozen string literal in guides/
2017-08-13 22:04:09 +09:00
Matthew Draper
87b3e226d6
Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
...
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30
Kir Shatrov
cfade1ec7e
Enforce frozen string in Rubocop
2017-07-01 02:11:03 +03:00
bogdanvlviv
40bdbce191
Define path with __dir__
...
".. with __dir__ we can restore order in the Universe." - by @fxn
Related to 5b8738c2df003a96f0e490c43559747618d10f5f
2017-05-23 00:53:51 +03:00
JD Gonzales
e37283b52e
Old expression caught to many chars resulting in 404. Added minor change to resolve
2017-05-12 22:54:11 -05:00
Rafael França
97f7575fde
Merge pull request #28337 from riseshia/patch-1
...
Fix to use correct path with language on guide
2017-05-03 21:04:03 -07:00
Shia
66cd83d9b9
Use target language's document.yaml [ci skip]
...
Let me build guide with "ko" language,
Before:
- It try to use guides/source/documents.yaml
After:
- It try to use guides/source/ko/documents.yaml
2017-05-04 12:47:05 +09:00
Rafael Mendonça França
0871e5e5c1
Fix all style guides violations
...
Closes #28382
Closes #28651
2017-04-19 20:13:42 -04:00
Ruy Diaz
b5c56090ee
Add anchor links to all headers
...
To allow easy linking at all levels and not just from index
2017-04-01 21:35:20 -07:00
Shia
ac00659b1b
Fix to use correct path with language on guide
2017-03-08 10:54:06 +09:00
Xavier Noria
771a802c37
refactors and fixes in guides generation [ci skip]
...
This commit is not precisely atomic, but the changes have evolved, summary:
* The ENV-based interface has been moved upwards, the generator has now a conventional
initializer.
* RAILS_VERSION is now assumed to be a Git tag. A blank RAILS_VERSION means edge guides.
* In consequence, the EDGE env variable is gone.
* The "local" version is also gone, the current SHA1 is computed for edge guides.
* Assumes guides are generated from a repo checkout (time ago users could
generate them from gems.)
* The WARNINGS flag is gone in consequence, you cannot disable warnings.
* The `api_link` Markdown helper is fixed.
* Docs about usage have one single place: rake guides:help.
* Links in guides have been revised.
2017-02-12 10:33:50 +01:00
Rafael Mendonça França
f04a49b033
Fix rubocop violations
2017-02-09 23:13:41 -03:00
Robin Dupret
ea141d62df
Automatically link to Ruby files referenced in notes [ci skip]
...
To ease reading the "Active Support Core Extensions" guide, let's
automatically link references to Ruby files.
It's also possible to reference other components' files in the even
though it's not used in the guides at the moment.
[Petr Skocik & Robin Dupret]
2017-02-07 21:45:53 +01:00
Robin Dupret
0676d28b22
Automatically inject the current Rails version in API links [ci skip]
...
To make sure that the user won't look at a feature that doesn't
already exist if they are looking at a previous version of the guides,
let's automatically inject the Rails version the guides have been
generated against.
2017-02-07 18:56:43 +01:00
Rafael Mendonça França
010e246756
Fix Rubocop violations and fix documentation visibility
...
Some methods were added to public API in
5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of
the public API.
2016-12-28 21:53:51 -05:00
Bian Jiaping
88792b1b2e
Fix rake guides:generate:kindle error
2016-12-18 23:13:50 +08:00
Rafael Mendonça França
fe1f4b2ad5
Add more rubocop rules about whitespaces
2016-10-29 01:17:49 -02:00
Rafael Mendonça França
8b3ed2b68a
Fix HTML escaping in the guides
...
render :html escapes the argument if not provided as html safe.
2016-10-25 11:19:28 -02:00
Rafael Mendonça França
0b4679f192
Fix indentation
2016-10-25 03:16:51 -02:00
Rafael Mendonça França
1e7f6488f7
Generate HTML not plain text
2016-10-25 03:06:57 -02:00
Rafael Mendonça França
d34a2747cb
Fix plain option in the rails_guides generator
2016-10-25 00:08:39 -02:00
Kasper Timm Hansen
2b5ed618ed
[ci skip] Update Levenshtein code with better attribution.
...
Lacks some proper creds to the homies who went the... distance ;)
2016-09-12 21:46:44 +02:00
Xavier Noria
810dff7c9f
RuboCop is 100% green 🎉
2016-09-02 00:43:33 +02:00
Rafael Mendonça França
55f9b8129a
Add three new rubocop rules
...
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
2016-08-16 04:30:11 -03:00
Ryuta Kamizono
f006de5dc5
Fix broken alignments caused by auto-correct commit 411ccbd
...
Hash syntax auto-correcting breaks alignments. 411ccbdab2608c62aabdb320d52cb02d446bb39c
2016-08-10 06:36:39 +09:00
Xavier Noria
b326e82dc0
applies remaining conventions across the project
2016-08-06 20:20:22 +02:00
Xavier Noria
80e66cc4d9
normalizes indentation and whitespace across the project
2016-08-06 20:16:27 +02:00
Xavier Noria
411ccbdab2
remove redundant curlies from hash arguments
2016-08-06 19:44:11 +02:00
Xavier Noria
1607ee299d
modernizes hash syntax in guides
2016-08-06 19:39:28 +02:00
Xavier Noria
6b3719b757
applies new string literal convention in guides
...
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:21:59 +02:00