Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 19c1b136ffa1
Choose a base ref
...
head repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ab0cade885cd
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Jun 2, 2016

  1. Add 'compile' command as an alias of the 'build' command.

    Remove 'build' command from compiler usage.
    
    Unify build/compile handling.
    
    Update compiler spec to use new 'compile' command.
    
    Compile/build command's name now always 'compile'.
    keplersj committed Jun 2, 2016
    Copy the full SHA
    97e8db9 View commit details
  2. Merge pull request #2725 from keplersj/compile-command

    Add 'compile' command as an alias of the 'build' command.
    jhass committed Jun 2, 2016
    Copy the full SHA
    cd9829f View commit details
  3. Copy the full SHA
    ab0cade View commit details
Showing with 10 additions and 7 deletions.
  1. +2 −2 spec/compiler/compiler_spec.cr
  2. +8 −5 src/compiler/crystal/command.cr
4 changes: 2 additions & 2 deletions spec/compiler/compiler_spec.cr
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ describe "Compiler" do
tempfile = Tempfile.new "compiler_spec_output"
tempfile.close

Crystal::Command.run ["build", "#{__DIR__}/data/compiler_sample", "-o", tempfile.path]
Crystal::Command.run ["compile", "#{__DIR__}/data/compiler_sample", "-o", tempfile.path]

File.exists?(tempfile.path).should be_true

@@ -18,7 +18,7 @@ describe "Compiler" do
tempfile = Tempfile.new "compiler_spec_output"
tempfile.close

Crystal::Command.run ["build", "#{__DIR__}/data/compiler_sample", "-o", tempfile.path]
Crystal::Command.run ["compile", "#{__DIR__}/data/compiler_sample", "-o", tempfile.path]

File.exists?(tempfile.path).should be_true

13 changes: 8 additions & 5 deletions src/compiler/crystal/command.cr
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ class Crystal::Command
Command:
init generate a new project
build compile program
compile compile program
deps install project dependencies
docs generate documentation
env print Crystal environment information
@@ -52,9 +52,12 @@ class Crystal::Command
when "init".starts_with?(command)
options.shift
init
when "build".starts_with?(command)
when "build".starts_with?(command), "compile".starts_with?(command)
if "build".starts_with?(command)
STDERR.puts "Deprecation: The build command was renamed to compile and will be removed in a future version."
end
options.shift
build
compile
when "play".starts_with?(command)
options.shift
playground
@@ -150,8 +153,8 @@ class Crystal::Command
Init.run(options)
end

private def build
config = create_compiler "build"
private def compile
config = create_compiler "compile"
config.compile
end