Commit Graph

89 Commits

Author SHA1 Message Date
Rafael Mendonça França e25a84adfc
Fix release task
We can't use a tag that looks like a version number, because npm will
fail.
2024-08-09 23:49:56 +00:00
Rafael Mendonça França e6d78d9033
Implement new versioning scheme for npm packages 2024-08-06 16:31:46 +00:00
Sean Doyle f9c51ec385 Rename text_area to textarea
Follow-up to [#52432][]
Related to [#52430][]

Helpers like `text_area_tag` construct [textarea][] elements. This
commit renames all view helper and form builder methods to replace
occurrences of `text_area` with `textarea`.

In the same style, this commit also renames the `rich_text`-prefixed
helpers to utilize a `textarea` suffix instead of the existing
`text_area` suffix.

To preserve backwards compatibility, this commit defines aliases for the
existing `text_area` format.

[#52432]: https://github.com/rails/rails/pull/52432
[#52430]: https://github.com/rails/rails/issues/52430
[textarea]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
2024-07-31 18:53:02 +02:00
David Heinemeier Hansson 8397eb24da
Remove rollup and test machinery for rails-ujs (#50535)
This leaves only the final compiled targets in place.
2024-01-02 16:49:36 +01:00
Jean Boussier c28e4f2434 Use double quotes more consistenly in doc and error messages
For better or worse, the Rails guide settled on double quotes
and a large part of the community also use rubocop which enforce
them by default.

So we might as well try to follow that style when providing code
snippets in the documentation or error messages.

Fix: https://github.com/rails/rails/issues/49822

I certainly didn't get them all, but consistency should be significantly
improved.
2023-10-28 11:38:49 +02:00
Summer ☀️ a062d182c3 Support `VISUAL` env var, and prefer it over `EDITOR` 2023-06-01 20:55:27 -06:00
Rafael Mendonça França ad9037aab8
Fix release script to publish the ujs package 2023-05-24 19:22:51 +00:00
fatkodima 3158bbb9f6 Update `rubocop-performance` and enable more performance-related cops 2022-08-26 15:07:11 +03:00
Niklas Haeusele 7a555e460f Update the npm package release task to not add the latest package for every version. 2022-06-28 23:16:09 +02:00
Mohit Sindhwani aecf24fb07
Provide change summary before details for all gems
Update announcement template to have summary of changes since previous release before the details for each gem.
2022-02-09 18:40:54 +08:00
Aaron Patterson 8f83351366
Add support for YubiKey OTP codes during release
This patch adds support for automatically getting OTP codes from your
YubiKey during release.  You must have the `ykman` commandline tool
installed, and have two accounts setup with the names `rubygems.org` and
`npmjs.com`.  For example, the output from `ykman oath accounts list` on
my machine is this:

```
$ ykman oath accounts list
npmjs.com:aaron.patterson@gmail.com
rubygems.org:aaron.patterson@gmail.com
```

If you meet these conditions, you can do `rake release` without typing
an OTP code for every gem.

If no `ykman` tool is found on your system, this will just fall back to
asking for an OTP code.
2021-12-14 12:48:01 -08:00
Ryuta Kamizono c03933af23 Fix a rubocop offence for `Lint/ErbNewArguments` 2021-02-05 12:39:58 +09:00
Rafael Mendonça França be2473b2ef
Fix release task 2019-11-27 12:24:31 -03:00
Rafael Mendonça França c9fe12fe8e
Fix announce script 2019-03-22 00:05:10 -04:00
Rafael Mendonça França 7f69ef7aea
Fix release template 2019-03-21 23:49:12 -04:00
Ryuta Kamizono 7ebfb319ff Enable `Lint/ErbNewArguments` cop to avoid the deprecated arguments warning
Related 5754a29a97.

And follows Ruby standard library style https://github.com/ruby/ruby/commit/3406c5d.
2019-02-01 14:20:11 +09:00
George Claghorn c1e949e9e6 Prefer ImageProcessing's resize_to_limit macro over resize_to_fit
Don't upsize images smaller than the specified dimensions.
2019-01-24 11:46:42 -05:00
Rafael Mendonça França 3c6cfdf7ad
Change release_sumary task to work in first releases of the series 2019-01-18 16:35:09 -05:00
Rafael Mendonça França ea83132e0e
Fix the user show page in the verify task 2019-01-18 15:39:39 -05:00
Kasper Timm Hansen a08827a90b
Exercise Active Storage and Action Text in verification app.
Allows the releaser to verify that:

- A rich text description can be edited and shown *richly*.
- An image/PDF can be uploaded and generate a variant that's shown.

Also moves the generated app to a tmp directory for less cleanup need.
2019-01-15 20:21:32 +01:00
Kasper Timm Hansen a64d7b470a
Install Action Mailbox and Action Text when verifying release. 2019-01-15 17:18:52 +01:00
Kasper Timm Hansen 842bc43f7f
The frameworks list is order dependent.
Ref: d507f332a9
2019-01-08 21:45:38 +01:00
Kevin Solorio ce90ded4ca add new frameworks to tasks/release.rb
The Frameworks collection was missing actiontext and actionmailbox,
this would mean they are skipped when running any tasks that
iterated through this collection

changes include

Breaking up frameworks declaration into multiple lines and put
them in order. This should make adding to the list easier and
if you need to scan it, they will be in order you would expect

Add `package` task to both actiontext and actionmailbox
2019-01-08 10:36:33 -08:00
Rafael Mendonça França 0421eecf13
Fix announcement draft formatting [ci skip] 2018-12-04 13:41:49 -05:00
Rafael Mendonça França b2465a0cc9
Add release link to the announcement [ci skip] 2018-12-04 13:41:43 -05:00
Rafael Mendonça França e91bf5966e
Improve the task to generate the release summary
Now it accepts the base release to be compared with.

[ci skip]
2018-12-04 13:41:36 -05:00
bogdanvlviv ea37ccddba
Fix rubocop offenses
- Layout/TrailingWhitespace

```
actionpack/lib/action_controller/metal/request_forgery_protection.rb:49:4:
C: Layout/TrailingWhitespace: Trailing whitespace detected.
  #
   ^
```

Related to c3787494ed

- Performance/StartWith

```
tasks/release.rb:108:44: C: Performance/StartWith:
Use String#start_with? instead of a regex match anchored to the beginning of the string.
      header += "*   No changes.\n\n\n" if current_contents =~ /\A##/
```
2018-08-15 08:34:31 +03: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
Xavier Noria be9a32b65f prefer File.write for bulk writes
I saw these ones while working on #32362.

File.write was introduced in Ruby 1.9.3 and it is the most concise way
to perform bulk writes (as File.read is for bulk reading).

The existing flags enabled binmode, but we are dumping text here.
The portable way to dump text is text mode. The only difference is
newlines, and portable code should in particular emit portable newlines.

Please note the hard-coded \ns are still correct. In languages with C
semantics for newlines like Ruby, Python, Perl, and others, "\n" is a
portable newline. Both when writing and when reading. On Windows, the
I/O layer is responsible for prepending a CR before each LF on writing,
and removing CRs followed by LFs on reading. On Unix, binmode is a
no-op.
2018-05-05 19:38:38 +02:00
Koichi ITO e8be4f0891 Deprecate safe_level of `ERB.new` in Ruby 2.6
### Summary

In a Rails application using Ruby 2.6.0-dev, when running `bin/rails g migration`
with `RUBYOPT=-w`, an ERB deprecation warnings will be displayed.

```console
% ruby -v
ruby 2.6.0dev (2018-03-03 trunk 62644) [x86_64-darwin17]
% bin/rails -v
Rails 6.0.0.alpha
% RUBYOPT=-w bin/rails g migration create_foos

(snip)

/Users/koic/src/github.com/rails/rails/railties/lib/rails/generators/migration.rb:66:
warning: Passing safe_level with the 2nd argument of ERB.new is
deprecated. Do not use it, and specify other arguments as keyword
arguments.
/Users/koic/src/github.com/rails/rails/railties/lib/rails/generators/migration.rb:66:
warning: Passing trim_mode with the 3rd argument of ERB.new is
deprecated. Use keyword argument like ERB.new(str, trim_mode: ...)
instead.
/Users/koic/src/github.com/rails/rails/railties/lib/rails/generators/migration.rb:66:
warning: Passing eoutvar with the 4th argument of ERB.new is
deprecated. Use keyword argument like ERB.new(str, eoutvar: ...)
instead.
      create    db/migrate/20180304002144_create_foos.rb
```

This PR suppresses the above deprecation warnings in Ruby 2.6.0-dev.

This warning is due to the interface of `ERB.new` will change from Ruby 2.6.

> Add :trim_mode and :eoutvar keyword arguments to ERB.new.
> Now non-keyword arguments other than first one are softly deprecated
> and will be removed when Ruby 2.5 becomes EOL. [Feature #14256]

2311087b68/NEWS (stdlib-updates-outstanding-ones-only)

The following addresses are related Ruby's commit.
https://github.com/ruby/ruby/commit/cc777d0

Also this PR will change `ERB.new` used in `tasks/release.rb`.

### Other Information

This PR uses `ERB.version` to switch `ERB.new` interface. Because Rails 6
supports multiple Ruby versions (Ruby 2.4.1 or higher), it need to
use the appropriate interface.

Using `ERB.version` instead of `RUBY_VERSON` is based on the following patch.
https://github.com/ruby/ruby/pull/1826

This patch is built into Ruby.
40db89c093
2018-03-05 18:49:45 +09:00
bogdanvlviv 9045875167
Remove unused variable `gem_version` from `tasks/release.rb` 2017-09-24 22:53:10 +03:00
Koichi ITO ef2016f888 Use frozen string literal in tasks/ 2017-08-13 22:04:42 +09:00
David Heinemeier Hansson 5528406603 Merge pull request #30020 from rails/active-storage-import
Add Active Storage to Rails
2017-08-04 18:05:13 -05:00
Claudio B 12d944f765 Add Active Storage to README and release (#30065)
Before we forget...
2017-08-04 17:55:24 -05:00
Rafael Mendonça França f7d0bd657f Fix all rubocop violations 2017-08-03 17:45:40 -04:00
Kasper Timm Hansen 3636d1f479
Fix github user output.
[ Orhan Toy & Kasper Timm Hansen ]
2017-07-30 16:09:36 +02:00
Kasper Timm Hansen 6f9b01c056
Use exact Rails version when verifying. 2017-07-25 22:00:07 +02:00
Kasper Timm Hansen 973c3211c6
Support multiple versions in release announcement.
So releasing 5.1 and 5.0 together won't require manual copy
and paste.
2017-07-22 21:17:25 +02:00
Kasper Timm Hansen 1e7acf844b
Add task to verify a release.
Basically revises the release flow to:

* Update the version in RAILS_VERSION + rake changelog:header
* Run rake all:verify (click around in the booted app)
* If that checks out, run rake release.
2017-07-22 21:17:25 +02:00
Matthew Draper 87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590, reversing
changes made to afb66a5a59.
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 5b8738c2df
2017-05-23 00:53:51 +03:00
Rafael Mendonça França fee4257f8d
Fix the blog post template header 2017-03-20 14:08:09 -04:00
Rafael Mendonça França 14ab460f8e
Use shasum 256 on the release 2017-02-24 20:02:37 -05:00
Matthew Draper 71df60e921
Rearrange npm release process again
Make prep_release idempotent, including the npm bump.
2017-02-23 15:14:20 -05:00
Matthew Draper d7c8d34cc4
Add a task to build a draft of the release announcement 2017-02-23 15:06:34 -05:00
Rafael Mendonça França d9d28d2437
Do not override the global variable
This will make the version of the next gems to change
2017-02-23 15:03:34 -05:00
Xavier Noria 60b67d76dc modernizes hash syntax in the rest of the project 2016-08-06 19:40:54 +02:00
Xavier Noria 78d3f84955 applies new string literal convention in tasks
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
2016-08-06 19:22:32 +02:00
eileencodes 297e262035 Fix release task now that NPM is part of the build
Note: this commit looks super weird becuase git. I'm moving the entire
NPM section to the part where we actually push the gems/npm package for
the reasons below. That's not how the git diff looks though.

When we release Rails we run `rake prep_release` which calls
`update_versions`. This was updating the NPM version as well. But when we
would later run `rake install` to test the installed gem
`update_versions` gets called again which causes the install to fail
because NPM sees the version is the same as the last run and refuses to
continue. If you forget to stash this will then cause the push to
RubyGems to fail because `update_versions` is called again and then NPM
will not continue because it thinks the version hasn't been changed even
though it has.

The correct solution would be to not update the NPM verion if it matches
the version already in the file but after an hour I could not find a
simple way to use NPM to read the current version. Honestly that's not
the best way to do it either because say you forget to update something
else and then the script thinks it's already been updated.

With that in mind I think the best solution is to not update the NPM
version until right before we are going to push to NPM because then that
won't cause the push to RubyGems to fail.
2016-07-01 10:58:06 -04:00