Skip to content

Commit

Permalink
Use shards version in crystal init tool
Browse files Browse the repository at this point in the history
  • Loading branch information
RX14 committed Dec 21, 2017
1 parent 7791254 commit 97ffdc7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
13 changes: 3 additions & 10 deletions spec/compiler/crystal/tools/init_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,11 @@ dependencies:
end

describe_file "example/src/example.cr" do |example|
example.should eq(%{require "./example/*"
# TODO: Write documentation for `Example`
example.should eq(%{# TODO: Write documentation for `Example`
module Example
# TODO: Put your code here
end
})
end
VERSION = {{ `shards version \#{__DIR__}`.chomp.stringify }}
describe_file "example/src/example/version.cr" do |version|
version.should eq(%{module Example
VERSION = "0.1.0"
# TODO: Put your code here
end
})
end
Expand Down
1 change: 0 additions & 1 deletion src/compiler/crystal/tools/init.cr
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ module Crystal
template ShardView, "shard.yml.ecr", "shard.yml"

template SrcExampleView, "example.cr.ecr", "src/#{config.name}.cr"
template SrcVersionView, "version.cr.ecr", "src/#{config.name}/version.cr"

template SpecHelperView, "spec_helper.cr.ecr", "spec/spec_helper.cr"
template SpecExampleView, "example_spec.cr.ecr", "spec/#{config.name}_spec.cr"
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/crystal/tools/init/template/example.cr.ecr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "./<%= config.name %>/*"

# TODO: Write documentation for `<%= module_name %>`
module <%= module_name %>
VERSION = {{ `shards version #{__DIR__}`.chomp.stringify }}

# TODO: Put your code here
end
3 changes: 0 additions & 3 deletions src/compiler/crystal/tools/init/template/version.cr.ecr

This file was deleted.

0 comments on commit 97ffdc7

Please sign in to comment.