Permalink
Browse files

Fix: specify ivar types for Crystal > 0.15

  • Loading branch information...
1 parent 3baa0a6 commit 333bdcaecc1826f9e8df85dc9b0433005e7ad84a @ysbaddaden ysbaddaden committed Apr 12, 2016
View
@@ -2,5 +2,5 @@ version: 1.0
shards:
minitest:
github: ysbaddaden/minitest.cr
- version: 0.3.2
+ version: 0.3.3
View
@@ -7,6 +7,5 @@ authors:
development_dependencies:
minitest:
github: ysbaddaden/minitest.cr
- version: ">= 0.2.0"
license: Apache-2.0
@@ -4,9 +4,12 @@ require "../spec"
module Shards
abstract class Command
- getter :path
- getter :spec_path
- getter :lockfile_path
+ getter path : String
+ getter spec_path : String
+ getter lockfile_path : String
+
+ @spec : Spec?
+ @locks : Array(Dependency)?
def initialize(path)
if File.directory?(path)
View
@@ -1,6 +1,6 @@
module Shards
class Dependency < Hash(String, String)
- property :name
+ property name : String
def initialize(@name)
super()
View
@@ -3,9 +3,9 @@ module Shards
end
class Conflict < Error
- getter :package
+ getter package
- def initialize(@package)
+ def initialize(@package : Package)
super "Error resolving #{package.name} (#{package.requirements.join(", ")})"
end
end
@@ -23,10 +23,10 @@ module Shards
end
class ParseError < Error
- getter :input
- getter :filename
- getter :line_number
- getter :column_number
+ getter input : String
+ getter filename : String
+ getter line_number : Int32
+ getter column_number : Int32
def initialize(message, @input, @filename, line_number, column_number)
@line_number = line_number.to_i
View
@@ -79,6 +79,8 @@ module Shards
@@colors = value
end
+ @@logger : Logger(IO::FileDescriptor)?
+
def self.logger
@@logger ||= Logger.new(STDOUT).tap do |logger|
logger.progname = "shards"
View
@@ -2,7 +2,9 @@ require "./package"
module Shards
class Manager
- getter :spec, :packages, :locks
+ getter spec : Spec
+ getter packages : Set
+ #getter locks : Array(Dependency)
def initialize(@spec, update_cache = true)
@packages = Set.new(update_cache: update_cache)
View
@@ -5,9 +5,11 @@ module Shards
class Package
include Helpers::Versions
- getter :requirements
+ getter requirements : Array(String)
+ @resolver : Resolver?
+ @available_versions : Array(String)?
- def initialize(@dependency, @update_cache = false)
+ def initialize(@dependency : Dependency, @update_cache = false)
@requirements = [] of String
end
@@ -5,6 +5,10 @@ module Shards
RELEASE_VERSION = /^v?([\d\.]+)$/
class GitResolver < Resolver
+ @@git_column_never : String?
+ @@git_version : String?
+ @origin_url : String?
+
# :nodoc:
def self.git_version
@@git_version ||= `git --version`.strip[12 .. -1]
@@ -9,7 +9,7 @@ module Shards
PROJECTFILE_GITHUB_RE = /github\s+"(.+?\/(.+?))"(.*)/
PROJECTFILE_GITHUB_BRANCH_RE = /"(.+?)"/
- getter :dependency
+ getter dependency : Dependency
def initialize(@dependency, @update_cache = true)
end
View
@@ -7,8 +7,8 @@ require "./errors"
module Shards
class Spec
class Author
- property :name
- property :email
+ property name : String
+ property email : String?
def self.new(pull : YAML::PullParser)
new(pull.read_scalar)
@@ -42,10 +42,10 @@ module Shards
parser.close if parser
end
- getter! :name
- getter! :version
- getter :description
- getter :license
+ getter! name : String?
+ getter! version : String?
+ getter description : String?
+ getter license : String?
# :nodoc:
def initialize(pull : YAML::PullParser, validate = false)
@@ -8,10 +8,18 @@ require "./support/factories"
require "./support/cli"
class Minitest::Test
+ def self.created_repositories?
+ @@created_repositories
+ end
+
+ def self.created_repositories!
+ @@created_repositories = true
+ end
+
def before_setup
super
- unless @@created_repositories
+ unless Minitest::Test.created_repositories?
run "rm -rf #{tmp_path}/*"
setup_repositories
end
@@ -48,7 +56,7 @@ class Minitest::Test
create_path_repository "foo"
- @@created_repositories = true
+ Minitest::Test.created_repositories!
end
def assert_installed(name, version = nil)
View
@@ -75,8 +75,10 @@ module Shards
end
end
+ @application_path : String?
+
def application_path
- @@application_path ||= File.expand_path("../../tmp/integration", __DIR__).tap do |path|
+ @application_path ||= File.expand_path("../../tmp/integration", __DIR__).tap do |path|
if File.exists?(path)
run("rm -rf #{path}/*", capture: false)
run("rm -rf #{path}/.shards", capture: false)
@@ -1,5 +1,6 @@
class FailedCommand < Exception
- getter :stdout, :stderr
+ getter stdout : String
+ getter stderr : String
def initialize(message, @stdout, @stderr)
super message
@@ -73,12 +74,14 @@ module Shards
"../../test/.repositories/#{project}"
end
+ @tmp_path : String?
+
def tmp_path
- @@tmp_path ||= begin
- path = File.expand_path("../../.repositories", __FILE__)
- Dir.mkdir(path) unless Dir.exists?(path)
- path
- end
+ @tmp_path ||= begin
+ path = File.expand_path("../../.repositories", __FILE__)
+ Dir.mkdir(path) unless Dir.exists?(path)
+ path
+ end
end
def run(command, capture = false)

0 comments on commit 333bdca

Please sign in to comment.