Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version numbers #319

Merged
merged 31 commits into from
Oct 27, 2017
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9df68f6
Add dependency badge
faustinoaq Oct 21, 2017
2512432
Update dependencies
faustinoaq Oct 21, 2017
cad3705
Change CMD to CLI
faustinoaq Oct 21, 2017
8b23e68
Add sentry_command helper
faustinoaq Oct 21, 2017
0c5139f
Use local sentry command
faustinoaq Oct 21, 2017
5d0482e
Use local sentry command
faustinoaq Oct 21, 2017
d94366a
Remove sentry fork
faustinoaq Oct 21, 2017
7f9de41
Add sentry dependency
faustinoaq Oct 21, 2017
0c0e1db
Remove icr fork and use original repo
faustinoaq Oct 21, 2017
590919a
Update dependencies
faustinoaq Oct 21, 2017
78a7523
Fix watch option
faustinoaq Oct 21, 2017
2444659
Add support for new options in Micrate::Cli
faustinoaq Oct 21, 2017
33883d2
Fix wrong number of arguments for run_dbversion
faustinoaq Oct 21, 2017
33736ab
Fix arguments for report_unordered_migrations
faustinoaq Oct 21, 2017
fd57730
Fix & update ICR version
faustinoaq Oct 21, 2017
f0e09b8
Update Micrate::Cli arguments
faustinoaq Oct 21, 2017
cd26c73
Fix micrate version
faustinoaq Oct 24, 2017
6a4ec70
Remove parameter changes
faustinoaq Oct 24, 2017
911f989
Remove parameter changes
faustinoaq Oct 24, 2017
7495fd2
Moving file
faustinoaq Oct 24, 2017
39da3c4
Create sentry command helper
faustinoaq Oct 24, 2017
09c9f29
Fix require
faustinoaq Oct 24, 2017
9fd6ac8
Fix require
faustinoaq Oct 24, 2017
c8a167f
Merge branch 'master' into fix-version-numbers
faustinoaq Oct 24, 2017
f55b231
Merge branch 'master' into fix-version-numbers
drujensen Oct 25, 2017
b8a34f1
Update Kilt
faustinoaq Oct 26, 2017
9b27a5e
Merge branch 'master' into fix-version-numbers
faustinoaq Oct 26, 2017
05e977f
Return old version
faustinoaq Oct 26, 2017
2bef546
Revert "Merge branch 'master' into fix-version-numbers"
faustinoaq Oct 26, 2017
4927e9e
Revert "Revert "Merge branch 'master' into fix-version-numbers""
faustinoaq Oct 27, 2017
2541fe9
Return old version of mosop/cli
faustinoaq Oct 27, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![license](https://img.shields.io/github/license/amberframework/amber.svg)](https://github.com/amberframework/amber/blob/master/LICENSE)
[![GitHub tag](https://img.shields.io/github/tag/amberframework/amber.svg)](https://github.com/amberframework/amber/releases/latest)
[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/veelenga/awesome-crystal/#web-frameworks)
[![Dependency Status](https://shards.rocks/badge/github/amberframework/amber/status.svg)](https://shards.rocks/github/amberframework/amber)

# Welcome to Amber

Expand Down
26 changes: 15 additions & 11 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,52 +19,56 @@ targets:
dependencies:
radix:
github: luislavena/radix
branch: master
version: ~> 0.3.8

kilt:
github: jeromegn/kilt
version: ~> 0.3.3

slang:
github: jeromegn/slang
branch: master
version: ~> 1.6.1

redis:
github: stefanwille/crystal-redis
version: ~> 1.8.0
version: ~> 1.9.0

cli:
github: mosop/cli
version: ~> 0.5.1
version: ~> 0.6.10

teeplate:
github: mosop/teeplate
version: ~> 0.4.4
version: ~> 0.4.5

icr:
github: TechMagister/crystal-icr
sentry:
github: samueleaton/sentry
branch: master

sentry:
github: TechMagister/sentry
branch: change_cli
icr:
github: crystal-community/icr
version: ~> 0.3.0

micrate:
github: juanedi/micrate
version: ~> 0.3.0

shell-table:
github: jwaldrip/shell-table.cr
version: ~> 0.9.1

spinner:
github: askn/spinner
version: ~> 0.1.1

pg:
github: will/crystal-pg
version: ~> 0.13.4

mysql:
github: crystal-lang/crystal-mysql
branch: master

sqlite3:
github: crystal-lang/crystal-sqlite3

branch: master
2 changes: 1 addition & 1 deletion src/amber/cli/commands.cr
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ end
module Amber::CLI
class MainCommand < ::Cli::Supercommand
command_name "amber"
version "Amber CMD (amberframework.org) - v#{VERSION}"
version "Amber CLI (amberframework.org) - v#{VERSION}"

class Help
title "\nAmber - Command Line Interface"
Expand Down
2 changes: 1 addition & 1 deletion src/amber/cli/commands/routes.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "cli"
require "shell-table"
require "sentry/sentry_command"
require "../sentry_command_helper"

module Amber::CLI
class MainCommand < ::Cli::Supercommand
Expand Down
2 changes: 1 addition & 1 deletion src/amber/cli/commands/watch.cr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require "cli"
require "sentry/sentry_command"
require "../sentry_command_helper"

module Amber::CLI
class MainCommand < ::Cli::Supercommand
Expand Down
103 changes: 103 additions & 0 deletions src/amber/cli/sentry_command_helper.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
require "yaml"
require "cli"

require "sentry"

module Sentry

class SentryCommand < Cli::Command

command_name "sentry"

SHARD_YML = "shard.yml"
DEFAULT_NAME = "[process_name]"

class Options

def self.defaults
name = Options.get_name
{
name: name,
process_name: "./#{name}",
build: "crystal build ./src/#{name}.cr",
watch: ["./src/**/*.cr", "./src/**/*.ecr"]
}
end

def self.get_name
if File.exists?(SHARD_YML) &&
(yaml = YAML.parse(File.read SHARD_YML)) &&
(name = yaml["name"]?)
name.as_s
else
DEFAULT_NAME
end
end

string %w(-n --name), desc: "Sets the name of the app process",
default: Options.defaults[:name]

string %w(-b --build), desc: "Overrides the default build command",
default: Options.defaults[:build]

string "--build-args", desc: "Specifies arguments for the build command"

bool "--no-build", desc: "Skips the build step", default: false

string %w(-r --run), desc: "Overrides the default run command",
default: Options.defaults[:process_name]

string "--run-args", desc: "Specifies arguments for the run command"

array %w(-w --watch),
desc: "Overrides default files and appends to list of watched files",
default: Options.defaults[:watch]

bool %w(-i --info),
desc: "Shows the values for build/run commands, build/run args, and watched files",
default: false

help

end

def run

if options.info?
puts "
name: #{options.name?}
build: #{options.build?}
build args: #{options.build_args?}
run: #{options.run?}
run args: #{options.run_args?}
files: #{options.watch}
"
exit! code: 0
end

build_args = if ba = options.build_args?
ba.split " "
else
[] of String
end
run_args = if ra = options.run_args?
ra.split " "
else
[] of String
end

process_runner = Sentry::ProcessRunner.new(
process_name: options.name,
build_command: options.build,
run_command: options.run,
build_args: build_args,
run_args: run_args,
should_build: !options.no_build?,
files: options.watch
)

process_runner.run

end
end
end