prick 0.19.0 → 0.20.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +10 -4
- data/README.md +7 -7
- data/Rakefile +3 -1
- data/TODO +13 -11
- data/bin/console +2 -1
- data/doc/build-yml.txt +14 -0
- data/exe/prick +237 -19
- data/lib/builder/batch.rb +147 -0
- data/lib/builder/builder.rb +122 -0
- data/lib/builder/node.rb +189 -0
- data/lib/builder/node_pool.rb +105 -0
- data/lib/builder/parser.rb +120 -0
- data/lib/local/command.rb +193 -0
- data/lib/{prick → local}/git.rb +148 -22
- data/lib/local/timer.rb +98 -0
- data/lib/prick/constants.rb +54 -66
- data/lib/prick/diff.rb +28 -18
- data/lib/prick/prick_version.rb +161 -0
- data/lib/prick/state.rb +80 -165
- data/lib/prick/version.rb +2 -163
- data/lib/prick.rb +38 -24
- data/lib/share/init/.gitignore +10 -0
- data/lib/share/init/.prick-context +2 -0
- data/lib/share/init/.rspec +3 -0
- data/{share/schema/schema/public → lib/share/init/migration}/.keep +0 -0
- data/lib/share/init/prick.yml +6 -0
- data/lib/share/init/schema/.keep +0 -0
- data/lib/share/init/schema/build.yml +2 -0
- data/lib/share/init/schema/prick/.keep +0 -0
- data/lib/share/init/schema/prick/build.yml +5 -0
- data/lib/share/init/schema/prick/data.sql +6 -0
- data/{share/schema → lib/share/init}/schema/prick/tables.sql +2 -3
- data/lib/share/init/schema/public/.keep +0 -0
- data/lib/share/init/spec/prick_helper.rb +1 -0
- data/lib/share/init/spec/prick_spec.rb +6 -0
- data/lib/share/init/spec/spec_helper.rb +50 -0
- data/lib/share/migrate/migration/build.yml +4 -0
- data/lib/share/migrate/migration/diff.after-tables.sql +0 -0
- data/lib/share/migrate/migration/diff.before-tables.sql +0 -0
- data/lib/share/migrate/migration/diff.tables.sql +0 -0
- data/lib/subcommand/prick-build.rb +55 -0
- data/lib/subcommand/prick-create.rb +78 -0
- data/lib/subcommand/prick-drop.rb +25 -0
- data/lib/subcommand/prick-fox.rb +62 -0
- data/lib/subcommand/prick-init.rb +46 -0
- data/lib/subcommand/prick-make.rb +202 -0
- data/lib/subcommand/prick-migrate.rb +37 -0
- data/lib/subcommand/prick-release.rb +23 -0
- data/lib/subcommand/prick-setup.rb +20 -0
- data/lib/subcommand/prick-teardown.rb +18 -0
- data/prick.gemspec +32 -21
- metadata +95 -76
- data/.gitignore +0 -29
- data/.travis.yml +0 -7
- data/doc/create_release.txt +0 -17
- data/doc/flow.txt +0 -98
- data/doc/migra +0 -1
- data/doc/migrations.txt +0 -172
- data/doc/notes.txt +0 -116
- data/doc/prick.txt +0 -114
- data/doc/sh.prick +0 -316
- data/lib/ext/algorithm.rb +0 -14
- data/lib/ext/fileutils.rb +0 -26
- data/lib/ext/forward_method.rb +0 -18
- data/lib/ext/pg.rb +0 -18
- data/lib/ext/shortest_path.rb +0 -44
- data/lib/prick/archive.rb +0 -124
- data/lib/prick/branch.rb +0 -265
- data/lib/prick/builder.rb +0 -246
- data/lib/prick/cache.rb +0 -34
- data/lib/prick/command.rb +0 -104
- data/lib/prick/database.rb +0 -82
- data/lib/prick/dsort.rb +0 -151
- data/lib/prick/ensure.rb +0 -119
- data/lib/prick/exceptions.rb +0 -25
- data/lib/prick/head.rb +0 -189
- data/lib/prick/migration.rb +0 -70
- data/lib/prick/program.rb +0 -287
- data/lib/prick/project.rb +0 -626
- data/lib/prick/rdbms.rb +0 -137
- data/lib/prick/schema.rb +0 -27
- data/lib/prick/share.rb +0 -64
- data/libexec/strip-comments +0 -33
- data/make_releases +0 -72
- data/make_schema +0 -10
- data/share/diff/diff.after-tables.sql +0 -4
- data/share/diff/diff.before-tables.sql +0 -4
- data/share/diff/diff.tables.sql +0 -8
- data/share/features/diff.sql +0 -2
- data/share/features/feature/diff.sql +0 -2
- data/share/features/feature/migrate.sql +0 -2
- data/share/features/features.sql +0 -2
- data/share/features/features.yml +0 -2
- data/share/features/migrations.sql +0 -4
- data/share/gitignore +0 -2
- data/share/migration/diff.tables.sql +0 -8
- data/share/migration/features.yml +0 -6
- data/share/migration/migrate.sql +0 -3
- data/share/migration/migrate.yml +0 -8
- data/share/migration/tables.sql +0 -3
- data/share/schema/build.yml +0 -14
- data/share/schema/schema/build.yml +0 -3
- data/share/schema/schema/prick/build.yml +0 -14
- data/share/schema/schema/prick/data.sql +0 -7
- data/share/schema/schema/prick/schema.sql +0 -3
- data/share/schema/schema/public/build.yml +0 -13
- data/share/schema/schema.sql +0 -3
- data/test_assorted +0 -192
- data/test_feature +0 -112
- data/test_refactor +0 -34
- data/test_single_dev +0 -83
data/lib/prick/state.rb
CHANGED
@@ -2,191 +2,106 @@
|
|
2
2
|
require 'yaml'
|
3
3
|
|
4
4
|
module Prick
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
def initialize(path) @path = path end
|
9
|
-
def exist?() File.exist?(path) end
|
10
|
-
def self.exist?() self.new.exist? end # Require an #initializer with no arguments
|
11
|
-
|
12
|
-
def self.load(*args) self.new(*args).read end
|
13
|
-
|
14
|
-
def self.read() raise NotThis end
|
15
|
-
|
16
|
-
protected
|
17
|
-
# Read file from disk or from the given branch or tag
|
18
|
-
def general_read(method, branch: nil, tag: nil)
|
19
|
-
!(branch && tag) or raise Internal, "Not both of `branch` and `tag` can be defined"
|
20
|
-
branch || tag ? Git.send(method, path, branch: branch, tag: tag) : File.open(path, "r").send(method)
|
21
|
-
end
|
5
|
+
class State
|
6
|
+
# State file
|
7
|
+
def file() PRICK_PROJECT_PATH end
|
22
8
|
|
23
|
-
|
24
|
-
def
|
25
|
-
def do_readlines(**opts) general_read(:readlines, **opts).reject { |l| l =~ /^\s*#/ } end
|
26
|
-
end
|
9
|
+
# Schema data file
|
10
|
+
def schema_file() SCHEMA_VERSION_PATH end
|
27
11
|
|
28
|
-
|
29
|
-
|
30
|
-
class PrickVersion < PrickFile
|
31
|
-
def initialize() super PRICK_VERSION_FILE end
|
12
|
+
# Used as an identifier and the default database and username
|
13
|
+
attr_accessor :name
|
32
14
|
|
33
|
-
#
|
34
|
-
|
35
|
-
Version.new(do_readline(branch: branch, tag: tag).chomp.sub(/^prick-/, ""))
|
36
|
-
end
|
15
|
+
# Capitalized name of project
|
16
|
+
attr_accessor :title
|
37
17
|
|
38
|
-
#
|
39
|
-
|
40
|
-
File.open(path, "w") { |file| file.puts "prick-#{version}" }
|
41
|
-
end
|
42
|
-
end
|
18
|
+
# Version in prick.yml. Can be nil
|
19
|
+
attr_accessor :version
|
43
20
|
|
44
|
-
|
45
|
-
|
46
|
-
# reset the cache
|
47
|
-
class SchemaVersion < PrickFile
|
48
|
-
def initialize(version = nil)
|
49
|
-
@version = version
|
50
|
-
super SCHEMA_VERSION_PATH
|
51
|
-
end
|
21
|
+
# Version in schema/prick/data.sql. Retrieved dynamically. TODO
|
22
|
+
attr_reader :schema_version
|
52
23
|
|
53
|
-
|
54
|
-
|
55
|
-
def create() raise Internal, "This should not happen" end
|
56
|
-
|
57
|
-
def read(**opts)
|
58
|
-
return @version if @version
|
59
|
-
lines = do_readlines
|
60
|
-
while !lines.empty?
|
61
|
-
line = lines.shift.chomp
|
62
|
-
next if line != COPY_STMT
|
63
|
-
data = lines.shift.chomp
|
64
|
-
a = data.split("\t").map { |val| parse_sql_literal(val) }
|
65
|
-
a.size == FIELDS.size + 1 or raise Fail, "Illegal data format in #{path}"
|
66
|
-
fork, major, minor, patch, pre, feature, version = *a[1..-1]
|
67
|
-
@version = Version.new("0.0.0", fork: fork, feature: feature)
|
68
|
-
@version.major = major
|
69
|
-
@version.minor = minor
|
70
|
-
@version.patch = patch
|
71
|
-
@version.pre = pre
|
72
|
-
return @version
|
73
|
-
end
|
74
|
-
raise Fail, "No COPY statement in #{path}"
|
75
|
-
end
|
24
|
+
# Version from prick.versions.version. Retrieved dynamically. TODO FIXME: Where is conn?
|
25
|
+
attr_reader :database_version
|
76
26
|
|
77
|
-
|
78
|
-
|
79
|
-
version_string = version.truncate(:pre).to_s
|
80
|
-
File.open(path, "w") { |f|
|
81
|
-
f.puts "--"
|
82
|
-
f.puts "-- This file is auto-generated by prick(1). Please don't touch"
|
83
|
-
f.puts COPY_STMT
|
84
|
-
f.print \
|
85
|
-
"1\t",
|
86
|
-
FIELDS[..-2].map { |f| version.send(f.to_sym) || '\N' }.join("\t"),
|
87
|
-
"\t#{version_string}\n"
|
88
|
-
f.puts "\\."
|
89
|
-
}
|
90
|
-
Git.add(path)
|
91
|
-
version
|
92
|
-
end
|
27
|
+
# Version of prick(1)
|
28
|
+
attr_accessor :prick_version
|
93
29
|
|
94
|
-
|
95
|
-
|
96
|
-
COPY_STMT = "COPY prick.versions (id, #{FIELDS.join(', ')}) FROM stdin;"
|
30
|
+
# Run-time environment. Can be :production, :development, or :test
|
31
|
+
attr_accessor :environment
|
97
32
|
|
98
|
-
|
99
|
-
|
100
|
-
when '\N', 'null'; nil
|
101
|
-
when/^\d+$/; s.to_i
|
102
|
-
else
|
103
|
-
s
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
# General interface for prick state files in YAML format
|
109
|
-
class State < PrickFile
|
110
|
-
# `fields` is a Hash from field name (Symbol) to field type (class) where a
|
111
|
-
# class can be a class known to YAML (Integer, String, etc.) or Version.
|
112
|
-
# The #initialize method generates an accessor methods for each field
|
113
|
-
def initialize(path, **fields)
|
114
|
-
super(path)
|
115
|
-
@fields = fields
|
116
|
-
@fields.each_key { |k| self.class.attr_accessor k }
|
117
|
-
@loaded = false
|
118
|
-
end
|
33
|
+
# Name of database
|
34
|
+
attr_accessor :database
|
119
35
|
|
120
|
-
|
36
|
+
# Name of database user
|
37
|
+
attr_accessor :username
|
121
38
|
|
122
|
-
def
|
123
|
-
|
124
|
-
|
39
|
+
def self.load
|
40
|
+
begin
|
41
|
+
h = YAML.load(File.read PRICK_PROJECT_PATH)
|
42
|
+
rescue Errno::ENOENT
|
43
|
+
raise Prick::Error, "Can't open project file: #{PRICK_PROJECT_PATH}"
|
125
44
|
end
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
45
|
+
state = State.new
|
46
|
+
state.name = h["name"]
|
47
|
+
state.title = h["title"]
|
48
|
+
state.version = h["version"] && PrickVersion.new(h["version"])
|
49
|
+
state.prick_version = h["prick"] && PrickVersion.new(h["prick"])
|
50
|
+
|
51
|
+
begin
|
52
|
+
h = YAML.load(File.read PRICK_CONTEXT_PATH)
|
53
|
+
rescue Errno::ENOENT
|
54
|
+
raise Prick::Error, "Can't open environment file: #{PRICK_CONTEXT_PATH}"
|
136
55
|
end
|
137
|
-
|
138
|
-
|
139
|
-
|
56
|
+
state.environment = h["environment"]&.to_sym
|
57
|
+
state.database = h["database"]
|
58
|
+
state.username = h["username"]
|
140
59
|
|
141
|
-
|
142
|
-
set(**fields)
|
143
|
-
hash = @fields.map { |field, klass|
|
144
|
-
value = self.send(field)
|
145
|
-
value = value.to_s if klass == Version && !value.nil?
|
146
|
-
[field.to_s, value]
|
147
|
-
}.to_h
|
148
|
-
IO.write(@path, YAML.dump(hash))
|
149
|
-
raise if @version.is_a?(Array)
|
150
|
-
self
|
151
|
-
end
|
152
|
-
end
|
60
|
+
# TODO Load schema version
|
153
61
|
|
154
|
-
|
155
|
-
def initialize(version: nil, base_version: nil)
|
156
|
-
super(PRICK_MIGRATION_PATH, version: Version, base_version: Version)
|
157
|
-
set(version: version, base_version: base_version)
|
62
|
+
state
|
158
63
|
end
|
159
|
-
end
|
160
64
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
65
|
+
def save
|
66
|
+
h = {
|
67
|
+
"name" => name,
|
68
|
+
"title" => title,
|
69
|
+
"version" => version.to_s,
|
70
|
+
"prick" => prick_version.to_s
|
71
|
+
}
|
72
|
+
File.write(PRICK_PROJECT_PATH, h.to_yaml)
|
167
73
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
74
|
+
h = {
|
75
|
+
"environment" => environment.to_s,
|
76
|
+
"database" => database,
|
77
|
+
"username" => username
|
78
|
+
}
|
79
|
+
File.write(PRICK_CONTEXT_PATH, h.to_yaml)
|
80
|
+
|
81
|
+
if version
|
82
|
+
File.write(SCHEMA_VERSION_PATH,
|
83
|
+
<<~EOS
|
84
|
+
--
|
85
|
+
-- This file is auto-generated by prick(1). Please don't touch
|
86
|
+
--
|
87
|
+
delete from prick.versions;
|
88
|
+
insert into prick.versions (fork, major, minor, patch, pre, feature, version)
|
89
|
+
values (null, #{version.major}, #{version.minor}, #{version.patch}, null, null, '#{version}');
|
90
|
+
EOS
|
91
|
+
)
|
92
|
+
end
|
172
93
|
end
|
173
|
-
end
|
174
94
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
#
|
182
|
-
|
183
|
-
|
184
|
-
# the database user
|
185
|
-
class ProjectState < State
|
186
|
-
def initialize(name: nil, user: nil)
|
187
|
-
super(PROJECT_STATE_FILE, name: String, user: String)
|
188
|
-
set(name: name, user: user)
|
95
|
+
def dump
|
96
|
+
puts "State"
|
97
|
+
indent {
|
98
|
+
for method in [
|
99
|
+
:name, :title, :prick_version, :project_version, :schema_version,
|
100
|
+
:database_version, :environment, :database, :username]
|
101
|
+
puts "#{method}: #{self.send method}"
|
102
|
+
end
|
103
|
+
}
|
189
104
|
end
|
190
105
|
end
|
191
|
-
|
192
106
|
end
|
107
|
+
|
data/lib/prick/version.rb
CHANGED
@@ -1,166 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
|
2
|
-
# "require 'semantic'" is moved to lib/prick.rb to avoid having Gem depend on it
|
3
|
-
# require 'semantic' # https://github.com/jlindsey/semantic
|
4
|
-
|
5
|
-
# Required by gem
|
6
3
|
module Prick
|
7
|
-
VERSION = "0.
|
4
|
+
VERSION = "0.20.1"
|
8
5
|
end
|
9
|
-
|
10
|
-
# Project related code starts here
|
11
|
-
module Prick
|
12
|
-
class Version
|
13
|
-
class FormatError < RuntimeError; end
|
14
|
-
|
15
|
-
include Comparable
|
16
|
-
|
17
|
-
PRE_LABEL = "pre"
|
18
|
-
PRE_RE = /^#{PRE_LABEL}\.(\d+)$/
|
19
|
-
|
20
|
-
def self.zero() Version.new("0.0.0") end
|
21
|
-
def zero?() self == Version.zero end
|
22
|
-
|
23
|
-
# Return true if `string` is a version
|
24
|
-
def self.version?(string)
|
25
|
-
string.is_a?(String) or raise Internal, "String expected"
|
26
|
-
!(string =~ VERSION_RE).nil?
|
27
|
-
end
|
28
|
-
|
29
|
-
attr_accessor :fork
|
30
|
-
attr_accessor :semver
|
31
|
-
attr_accessor :feature
|
32
|
-
|
33
|
-
def major() @semver.major end
|
34
|
-
def major=(major) @semver.major = major end
|
35
|
-
|
36
|
-
def minor() @semver.minor end
|
37
|
-
def minor=(minor) @semver.minor = minor end
|
38
|
-
|
39
|
-
def patch() @semver.patch end
|
40
|
-
def patch=(patch) @semver.patch = patch end
|
41
|
-
|
42
|
-
# Return true if this is a fork release
|
43
|
-
def fork?() !@fork.nil? end
|
44
|
-
|
45
|
-
# Return true if this is a feature release
|
46
|
-
def feature?() !@feature.nil? end
|
47
|
-
|
48
|
-
# Return true if this is a release branch (and not a prerelease)
|
49
|
-
def release?() !feature? && !pre? end
|
50
|
-
|
51
|
-
# Return true if this is a pre-release
|
52
|
-
def pre?() !@semver.pre.nil? end
|
53
|
-
def prerelease?() pre? end
|
54
|
-
|
55
|
-
# The releases is stored as a String (eg. 'pre.1') in the semantic version
|
56
|
-
# but #pre returns only the Integer number
|
57
|
-
def pre() @semver.pre =~ PRE_RE ? $1.to_i : nil end
|
58
|
-
def prerelease() pre end
|
59
|
-
|
60
|
-
# #pre= expects an integer or nil argument
|
61
|
-
def pre=(pre) @semver.pre = (pre ? "#{PRE_LABEL}.#{pre}" : nil) end
|
62
|
-
def prerelease=(pre) self.pre = pre end
|
63
|
-
|
64
|
-
def dup() Version.new(self) end
|
65
|
-
def clone() Version.new(self) end
|
66
|
-
|
67
|
-
def eql?(other) self == other end
|
68
|
-
def hash() @semver.hash end
|
69
|
-
|
70
|
-
def initialize(version, fork: nil, feature: nil)
|
71
|
-
case version
|
72
|
-
when String
|
73
|
-
version =~ VERSION_RE or raise Version::FormatError, "Expected a version, got #{version.inspect}"
|
74
|
-
@fork = fork || $1
|
75
|
-
@semver = Semantic::Version.new($3)
|
76
|
-
@feature = feature || $4
|
77
|
-
when Semantic::Version
|
78
|
-
@fork = fork
|
79
|
-
@semver = version.dup
|
80
|
-
@feature = feature
|
81
|
-
when Version
|
82
|
-
@fork = fork || version.fork
|
83
|
-
@semver = version.semver.dup
|
84
|
-
@feature = feature || version.feature
|
85
|
-
else
|
86
|
-
raise Internal, "Expected a String, Version, or Semantic::Version, got #{version.class}"
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
# Try converting the string `version` into a Version object. Return nil if unsuccessful
|
91
|
-
def self.try(version)
|
92
|
-
version.is_a?(Version) ? version : (version?(version) ? new(version) : nil)
|
93
|
-
end
|
94
|
-
|
95
|
-
# Parse a branch or tag name into a Version object. Return a [version, tag]
|
96
|
-
# tuple where tag is true if name was a tag
|
97
|
-
def self.parse(name)
|
98
|
-
name =~ VERSION_RE or raise Version::FormatError, "Expected a version, got #{name.inspect}"
|
99
|
-
fork, tag, semver, feature = $1, $2, $3, $4
|
100
|
-
version = Version.new(semver, fork: fork, feature: feature)
|
101
|
-
[version, tag]
|
102
|
-
end
|
103
|
-
# `part` can be one of :major, :minor, :patch, or :pre. If pre is undefined, it
|
104
|
-
# is set to `pre_initial_value`
|
105
|
-
def increment(part, pre_initial_value = 1)
|
106
|
-
self.dup.increment!(part, pre_initial_value)
|
107
|
-
end
|
108
|
-
|
109
|
-
def increment!(part, pre_initial_value = 1)
|
110
|
-
if part == :pre
|
111
|
-
self.pre = (self.pre ? self.pre + 1 : pre_initial_value)
|
112
|
-
else
|
113
|
-
@semver = semver.increment!(part)
|
114
|
-
end
|
115
|
-
self
|
116
|
-
end
|
117
|
-
|
118
|
-
def truncate(part)
|
119
|
-
case part
|
120
|
-
when :pre
|
121
|
-
v = self.dup
|
122
|
-
v.feature = nil
|
123
|
-
v.pre = nil
|
124
|
-
v
|
125
|
-
when :feature
|
126
|
-
v = self.dup
|
127
|
-
v.feature = nil
|
128
|
-
v
|
129
|
-
else
|
130
|
-
raise NotYet
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
# def path
|
135
|
-
# parts = [FEATURE_DIR, truncate(:pre), feature].compact
|
136
|
-
# File.join(*parts)
|
137
|
-
# end
|
138
|
-
|
139
|
-
# def link
|
140
|
-
# !feature? or raise Internal, "Version #{to_s} is a feature, not a release"
|
141
|
-
# File.join(RELEASE_DIR, to_s)
|
142
|
-
# end
|
143
|
-
|
144
|
-
def <=>(other)
|
145
|
-
r = (fork || "") <=> (other.fork || "")
|
146
|
-
return r if r != 0
|
147
|
-
r = semver <=> other.semver
|
148
|
-
return r if r != 0
|
149
|
-
r = (feature || "") <=> (other.feature || "")
|
150
|
-
return r
|
151
|
-
end
|
152
|
-
|
153
|
-
# Render as branch
|
154
|
-
def to_s(tag: false)
|
155
|
-
(fork ? "#{fork}-" : "") + (tag ? "v" : "") + semver.to_s + (feature ? "_#{feature}" : "")
|
156
|
-
end
|
157
|
-
|
158
|
-
# Render as a tag
|
159
|
-
def to_tag() to_s(tag: true) end
|
160
|
-
|
161
|
-
# Render as string
|
162
|
-
def inspect() to_s end
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
|
data/lib/prick.rb
CHANGED
@@ -1,33 +1,47 @@
|
|
1
|
+
require 'prick/version.rb'
|
1
2
|
|
2
|
-
|
3
|
+
require 'pg_conn'
|
3
4
|
|
4
|
-
|
5
|
-
require
|
5
|
+
require 'fixture_fox'
|
6
|
+
require 'indented_io'
|
7
|
+
require 'constrain'
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
+
module Prick
|
10
|
+
class Error < RuntimeError; end
|
11
|
+
class Fail < RuntimeError; end
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'prick/constants.rb'
|
9
15
|
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require "prick/command.rb"
|
14
|
-
require "prick/constants.rb"
|
15
|
-
require "prick/database.rb"
|
16
|
-
require "prick/diff.rb"
|
17
|
-
require "prick/exceptions.rb"
|
18
|
-
require "prick/git.rb"
|
19
|
-
require "prick/head.rb"
|
20
|
-
require "prick/project.rb"
|
21
|
-
require "prick/rdbms.rb"
|
22
|
-
require "prick/schema.rb"
|
23
|
-
require "prick/share.rb"
|
24
|
-
require "prick/state.rb"
|
25
|
-
require "prick/version.rb"
|
16
|
+
require 'local/command.rb'
|
17
|
+
require 'local/git.rb'
|
18
|
+
require 'local/timer.rb'
|
26
19
|
|
27
|
-
require
|
28
|
-
require
|
20
|
+
require 'prick/state.rb'
|
21
|
+
require 'prick/prick_version.rb'
|
22
|
+
require 'prick/diff.rb'
|
23
|
+
|
24
|
+
module Prick
|
25
|
+
module SubCommand
|
26
|
+
extend Timer
|
27
|
+
def self.mesg(*msgs) puts msgs.join(" ") if !$quiet end
|
28
|
+
def self.verb(*msgs) puts msgs.join(" ") if $verbose && !$quiet end
|
29
|
+
end
|
30
|
+
end
|
29
31
|
|
30
|
-
|
32
|
+
require 'subcommand/prick-init.rb'
|
33
|
+
require 'subcommand/prick-setup.rb'
|
34
|
+
require 'subcommand/prick-teardown.rb'
|
35
|
+
require 'subcommand/prick-create.rb'
|
36
|
+
require 'subcommand/prick-build.rb'
|
37
|
+
require 'subcommand/prick-make.rb'
|
38
|
+
require 'subcommand/prick-fox.rb'
|
39
|
+
require 'subcommand/prick-drop.rb'
|
40
|
+
require 'subcommand/prick-release.rb'
|
41
|
+
require 'subcommand/prick-migrate.rb'
|
31
42
|
|
32
43
|
module Prick
|
44
|
+
@state = nil
|
45
|
+
def self.state() @state end
|
46
|
+
def self.state=(state) @state = state end
|
33
47
|
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
-- Controlled by prick(1). Don't touch
|
3
2
|
--
|
4
3
|
|
@@ -12,6 +11,6 @@ create table versions (
|
|
12
11
|
patch integer not null,
|
13
12
|
pre integer,
|
14
13
|
feature varchar,
|
15
|
-
version varchar not null
|
14
|
+
version varchar not null,
|
15
|
+
built_at timestamp without time zone not null default (now() at time zone 'UTC')
|
16
16
|
);
|
17
|
-
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'prick/constants.rb'
|
@@ -0,0 +1,50 @@
|
|
1
|
+
|
2
|
+
# Set up paths to fox-project libraries
|
3
|
+
libdirs = `fox-project-libdirs 2>/dev/null`.chomp.split(":")
|
4
|
+
if !libdirs.empty?
|
5
|
+
$LOAD_PATH.unshift(*libdirs)
|
6
|
+
end
|
7
|
+
|
8
|
+
require "bundler/setup"
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
11
|
+
# Enable flags like --only-failures and --next-failure
|
12
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
13
|
+
|
14
|
+
# Disable RSpec exposing methods globally on `Module` and `main`
|
15
|
+
# config.disable_monkey_patching!
|
16
|
+
|
17
|
+
config.expect_with :rspec do |c|
|
18
|
+
c.syntax = :expect
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# Silence most of the output from pending tests. See https://github.com/rspec/rspec-core/issues/2377
|
23
|
+
module FormatterOverrides
|
24
|
+
def example_pending(n)
|
25
|
+
colorizer=::RSpec::Core::Formatters::ConsoleCodes
|
26
|
+
output << current_indentation \
|
27
|
+
<< colorizer.wrap(n.example.description, :pending) \
|
28
|
+
<< "\n"
|
29
|
+
end
|
30
|
+
|
31
|
+
def dump_pending(_)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
RSpec::Core::Formatters::DocumentationFormatter.prepend FormatterOverrides
|
36
|
+
|
37
|
+
# Postspec
|
38
|
+
require "postspec"
|
39
|
+
require 'postspec_helper'
|
40
|
+
require 'prick_helper'
|
41
|
+
|
42
|
+
Postspec.configure do |config|
|
43
|
+
config.database = "mikras"
|
44
|
+
# config.anchors = "..."
|
45
|
+
config.mode = :seed
|
46
|
+
config.reflections = Prick::REFLECTIONS_PATH if File.exist?(Prick::REFLECTIONS_PATH)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Local modifications
|
50
|
+
|
File without changes
|
File without changes
|
File without changes
|