Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
prism (1.9.0)
prism (2.0.0.rc1)

GEM
remote: https://rubygems.org/
Expand Down
7 changes: 4 additions & 3 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ ruby -pi -e 'gsub(/PRISM_VERSION_PATCH \d+/, %Q{PRISM_VERSION_PATCH #{ENV["PRISM
ruby -pi -e 'gsub(/PRISM_VERSION ".+?"/, %Q{PRISM_VERSION "#{ENV["PRISM_VERSION"]}"})' include/prism/version.h
ruby -pi -e 'gsub(/"version": ".+?"/, %Q{"version": "#{ENV["PRISM_VERSION"]}"})' javascript/package.json
ruby -pi -e 'gsub(/lossy\(\), ".+?"/, %Q{lossy(), "#{ENV["PRISM_VERSION"]}"})' rust/ruby-prism-sys/tests/utils_tests.rs
ruby -pi -e 'gsub(/\d+, "prism major/, %Q{#{ENV["PRISM_MAJOR"]}, "prism major})' templates/java/org/ruby_lang/prism/Loader.java.erb
ruby -pi -e 'gsub(/\d+, "prism minor/, %Q{#{ENV["PRISM_MINOR"]}, "prism minor})' templates/java/org/ruby_lang/prism/Loader.java.erb
ruby -pi -e 'gsub(/\d+, "prism patch/, %Q{#{ENV["PRISM_PATCH"]}, "prism patch})' templates/java/org/ruby_lang/prism/Loader.java.erb
ruby -pi -e 'gsub(/assertEquals\(".+?", prism.version\(\)\)/, %Q{assertEquals("#{ENV["PRISM_VERSION"]}", prism.version())})' java/wasm/src/test/java/org/jruby/parser/prism/WASMTest.java
ruby -pi -e 'gsub(/\d+, "prism major/, %Q{#{ENV["PRISM_MAJOR"]}, "prism major})' templates/java/api/src/main/java-templates/org/ruby_lang/prism/Loader.java.erb
ruby -pi -e 'gsub(/\d+, "prism minor/, %Q{#{ENV["PRISM_MINOR"]}, "prism minor})' templates/java/api/src/main/java-templates/org/ruby_lang/prism/Loader.java.erb
ruby -pi -e 'gsub(/\d+, "prism patch/, %Q{#{ENV["PRISM_PATCH"]}, "prism patch})' templates/java/api/src/main/java-templates/org/ruby_lang/prism/Loader.java.erb
ruby -pi -e 'gsub(/MAJOR_VERSION = \d+/, %Q{MAJOR_VERSION = #{ENV["PRISM_MAJOR"]}})' templates/javascript/src/deserialize.js.erb
ruby -pi -e 'gsub(/MINOR_VERSION = \d+/, %Q{MINOR_VERSION = #{ENV["PRISM_MINOR"]}})' templates/javascript/src/deserialize.js.erb
ruby -pi -e 'gsub(/PATCH_VERSION = \d+/, %Q{PATCH_VERSION = #{ENV["PRISM_PATCH"]}})' templates/javascript/src/deserialize.js.erb
Expand Down
2 changes: 1 addition & 1 deletion ext/prism/extension.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef PRISM_EXT_NODE_H
#define PRISM_EXT_NODE_H

#define EXPECTED_PRISM_VERSION "1.9.0"
#define EXPECTED_PRISM_VERSION "2.0.0.rc1"

#include <ruby.h>
#include <ruby/encoding.h>
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/2.7/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
prism (1.9.0)
prism (2.0.0.rc1)

GEM
remote: https://rubygems.org/
Expand All @@ -11,7 +11,7 @@ GEM
parser (3.3.12.0)
ast (~> 2.4.1)
racc
power_assert (3.0.1)
power_assert (3.1.0)
racc (1.8.1)
rake (13.4.2)
rake-compiler (1.3.2)
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/3.0/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
prism (1.9.0)
prism (2.0.0.rc1)

GEM
remote: https://rubygems.org/
Expand All @@ -11,7 +11,7 @@ GEM
parser (3.3.12.0)
ast (~> 2.4.1)
racc
power_assert (3.0.1)
power_assert (3.1.0)
racc (1.8.1)
rake (13.4.2)
rake-compiler (1.3.2)
Expand Down
4 changes: 2 additions & 2 deletions gemfiles/3.1/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
prism (1.9.0)
prism (2.0.0.rc1)

GEM
remote: https://rubygems.org/
Expand All @@ -11,7 +11,7 @@ GEM
parser (3.3.12.0)
ast (~> 2.4.1)
racc
power_assert (3.0.1)
power_assert (3.1.0)
racc (1.8.1)
rake (13.4.2)
rake-compiler (1.3.2)
Expand Down
6 changes: 3 additions & 3 deletions gemfiles/3.2/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
prism (1.9.0)
prism (2.0.0.rc1)

GEM
remote: https://rubygems.org/
Expand All @@ -11,15 +11,15 @@ GEM
parser (3.3.12.0)
ast (~> 2.4.1)
racc
power_assert (3.0.1)
power_assert (3.1.0)
racc (1.8.1)
rake (13.4.2)
rake-compiler (1.3.2)
rake
ruby_parser (3.22.0)
racc (~> 1.5)
sexp_processor (~> 4.16)
sexp_processor (4.17.5)
sexp_processor (4.17.6)
test-unit (3.7.8)
power_assert

Expand Down
6 changes: 3 additions & 3 deletions gemfiles/3.3/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
prism (1.9.0)
prism (2.0.0.rc1)

GEM
remote: https://rubygems.org/
Expand All @@ -11,15 +11,15 @@ GEM
parser (3.3.12.0)
ast (~> 2.4.1)
racc
power_assert (3.0.1)
power_assert (3.1.0)
racc (1.8.1)
rake (13.4.2)
rake-compiler (1.3.2)
rake
ruby_parser (3.22.0)
racc (~> 1.5)
sexp_processor (~> 4.16)
sexp_processor (4.17.5)
sexp_processor (4.17.6)
test-unit (3.7.8)
power_assert

Expand Down
6 changes: 3 additions & 3 deletions gemfiles/3.4/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
prism (1.9.0)
prism (2.0.0.rc1)

GEM
remote: https://rubygems.org/
Expand All @@ -11,15 +11,15 @@ GEM
parser (3.3.12.0)
ast (~> 2.4.1)
racc
power_assert (3.0.1)
power_assert (3.1.0)
racc (1.8.1)
rake (13.4.2)
rake-compiler (1.3.2)
rake
ruby_parser (3.22.0)
racc (~> 1.5)
sexp_processor (~> 4.16)
sexp_processor (4.17.5)
sexp_processor (4.17.6)
test-unit (3.7.8)
power_assert

Expand Down
6 changes: 3 additions & 3 deletions gemfiles/4.0/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
prism (1.9.0)
prism (2.0.0.rc1)

GEM
remote: https://rubygems.org/
Expand All @@ -11,15 +11,15 @@ GEM
parser (3.3.12.0)
ast (~> 2.4.1)
racc
power_assert (3.0.1)
power_assert (3.1.0)
racc (1.8.1)
rake (13.4.2)
rake-compiler (1.3.2)
rake
ruby_parser (3.22.0)
racc (~> 1.5)
sexp_processor (~> 4.16)
sexp_processor (4.17.5)
sexp_processor (4.17.6)
test-unit (3.7.8)
power_assert

Expand Down
2 changes: 1 addition & 1 deletion gemfiles/4.1/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
prism (1.9.0)
prism (2.0.0.rc1)

GEM
remote: https://rubygems.org/
Expand Down
6 changes: 3 additions & 3 deletions include/prism/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
/**
* The major version of the Prism library as an int.
*/
#define PRISM_VERSION_MAJOR 1
#define PRISM_VERSION_MAJOR 2

/**
* The minor version of the Prism library as an int.
*/
#define PRISM_VERSION_MINOR 9
#define PRISM_VERSION_MINOR 0

/**
* The patch version of the Prism library as an int.
Expand All @@ -26,7 +26,7 @@
/**
* The version of the Prism library as a constant string.
*/
#define PRISM_VERSION "1.9.0"
#define PRISM_VERSION "2.0.0.rc1"

/**
* The prism version and the serialization format.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void testMBCIdentifier() {
@Test
public void testVersion() {
try (Prism prism = new Prism()) {
assertEquals("1.9.0", prism.version());
assertEquals("2.0.0.rc1", prism.version());
}
}
}
2 changes: 1 addition & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ruby/prism",
"version": "1.9.0",
"version": "2.0.0-rc.1",
"description": "Prism Ruby parser",
"type": "module",
"main": "src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion prism.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "prism"
spec.version = "1.9.0"
spec.version = "2.0.0.rc1"
spec.authors = ["Shopify"]
spec.email = ["ruby@shopify.com"]

Expand Down
25 changes: 20 additions & 5 deletions rakelib/cargo.rake
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
namespace :cargo do
module GemspecVersion
def self.version(gemspec)
version = gemspec.version

if version.prerelease?
major, minor, patch, rc, prerelease = version.segments
"#{major}.#{minor}.#{patch}-#{rc}.#{prerelease}"
else
version.to_s
end
end
end

CRATES = ["ruby-prism-sys", "ruby-prism"]

desc "Build and test the Rust packages"
Expand All @@ -7,17 +20,18 @@ namespace :cargo do
require "yaml"

gemspec = Gem::Specification.load("prism.gemspec")
version = GemspecVersion.version(gemspec)

prism_sys_dir = Pathname(File.expand_path(File.join(__dir__, "../rust", "ruby-prism-sys")))
prism_sys_vendor_dir = prism_sys_dir.join("vendor/prism-#{gemspec.version}")
prism_sys_vendor_dir = prism_sys_dir.join("vendor/prism-#{version}")

rm_rf(prism_sys_dir.join("vendor"))
mkdir_p(prism_sys_vendor_dir)
cp_r("./include", prism_sys_vendor_dir.join("include"))
cp_r("./src", prism_sys_vendor_dir.join("src"))

prism_dir = Pathname(File.expand_path(File.join(__dir__, "../rust", "ruby-prism")))
prism_vendor_dir = prism_dir.join("vendor/prism-#{gemspec.version}")
prism_vendor_dir = prism_dir.join("vendor/prism-#{version}")

rm_rf(prism_dir.join("vendor"))
mkdir_p(prism_vendor_dir)
Expand All @@ -32,8 +46,8 @@ namespace :cargo do
cargo_toml_path = Pathname.new("rust/#{crate}/Cargo.toml")
old_cargo_toml = cargo_toml_path.read
new_cargo_toml = old_cargo_toml
.gsub(/^version = ".*"/, %(version = "#{gemspec.version}"))
.gsub(/^ruby-prism-sys = { version = ".*",/, %(ruby-prism-sys = { version = "#{gemspec.version}",))
.gsub(/^version = ".*"/, %(version = "#{version}"))
.gsub(/^ruby-prism-sys = { version = ".*",/, %(ruby-prism-sys = { version = "#{version}",))

File.write(cargo_toml_path, new_cargo_toml)
end
Expand All @@ -42,6 +56,7 @@ namespace :cargo do
desc "Regenerate the pregenerated bindings for ruby-prism-sys"
task bindings: [:build] do
gemspec = Gem::Specification.load("prism.gemspec")
version = GemspecVersion.version(gemspec)

generated_path = File.expand_path("../rust/target/pregenerated-bindings.rs", __dir__)
mkdir_p(File.dirname(generated_path))
Expand All @@ -56,7 +71,7 @@ namespace :cargo do

header = <<~HEADER
/* Generated by `bundle exec rake cargo:bindings`. Do not edit by hand.
* prism #{gemspec.version}, bindgen #{bindgen_version}, layout_tests(false)
* prism #{version}, bindgen #{bindgen_version}, layout_tests(false)
* so the file stays portable across pointer widths.
*/
HEADER
Expand Down
4 changes: 2 additions & 2 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/ruby-prism-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ruby-prism-sys"
version = "1.9.0"
version = "2.0.0-rc.1"
edition = "2021"
license = "MIT"
repository = "https://github.com/ruby/prism"
Expand Down
2 changes: 1 addition & 1 deletion rust/ruby-prism-sys/src/bindings.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/ruby-prism-sys/tests/utils_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ fn version_test() {
CStr::from_ptr(version)
};

assert_eq!(&cstring.to_string_lossy(), "1.9.0");
assert_eq!(&cstring.to_string_lossy(), "2.0.0.rc1");
}
4 changes: 2 additions & 2 deletions rust/ruby-prism/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ruby-prism"
version = "1.9.0"
version = "2.0.0-rc.1"
edition = "2021"
license = "MIT"
repository = "https://github.com/ruby/prism"
Expand All @@ -26,7 +26,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

[dependencies]
ruby-prism-sys = { version = "1.9.0", path = "../ruby-prism-sys" }
ruby-prism-sys = { version = "2.0.0-rc.1", path = "../ruby-prism-sys" }

[features]
default = ["vendored"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public class Loader {
expect((byte) 'S', "incorrect prism header");
expect((byte) 'M', "incorrect prism header");

expect((byte) 1, "prism major version does not match");
expect((byte) 9, "prism minor version does not match");
expect((byte) 2, "prism major version does not match");
expect((byte) 0, "prism minor version does not match");
expect((byte) 0, "prism patch version does not match");

expect((byte) 1, "Loader.java requires no location fields in the serialized output");
Expand Down
4 changes: 2 additions & 2 deletions templates/javascript/src/deserialize.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { getDecoder } from "./decoding.js";
import { Location } from "./location.js";
import { Source } from "./source.js";

const MAJOR_VERSION = 1;
const MINOR_VERSION = 9;
const MAJOR_VERSION = 2;
const MINOR_VERSION = 0;
const PATCH_VERSION = 0;

/* The DataView getFloat64 function takes an optional second argument that
Expand Down
Loading
Loading