Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ sudo: false
rvm:
- 2.1
- 2.2
cache: bundler
before_script:
- bundle exec rake db:migrate
env:
matrix:
- SUBPROJECT=adhoq-core RAILS_VERSION=3.2
- SUBPROJECT=adhoq-core RAILS_VERSION=4.0
- SUBPROJECT=adhoq-core RAILS_VERSION=4.1
- SUBPROJECT=adhoq-core RAILS_VERSION=4.2
- SUBPROJECT=adhoq-rails RAILS_VERSION=3.2
- SUBPROJECT=adhoq-rails RAILS_VERSION=4.0
- SUBPROJECT=adhoq-rails RAILS_VERSION=4.1
- SUBPROJECT=adhoq-rails RAILS_VERSION=4.2
global:
secure: a+K4odT4GG5TVJ/vgK4JRcgV1ZaT8uLNNshf0h0ZjOsJQEvc60NF7i4C8epZatnx66YhKHzFaI3T/hvmVVbtefanBCnPfCH1NJQWFpmaeya8M7GBPWmQgXVpgqWR3tVuOZNzTQDEAdAg04JMYdGs1hDY9P+RIHHBbj7yeVgQZcI=
gemfile:
- gemfiles/Gemfile-rails-3.2.x
- gemfiles/Gemfile-rails-4.0.x
- gemfiles/Gemfile-rails-4.1.x
- gemfiles/Gemfile-rails-4.2.x
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
source "https://rubygems.org"

gem 'adhoq-core', path: './adhoq-core'
gem 'adhoq-rails', path: './adhoq-rails'

# Declare your gem's dependencies in adhoq.gemspec.
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
Expand Down
50 changes: 28 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
PATH
remote: .
specs:
adhoq (0.0.5)
active_decorator
adhoq (0.1.0)
adhoq-core
adhoq-rails

PATH
remote: ./adhoq-core
specs:
adhoq-core (0.1.0)
activerecord (>= 3.2)
activesupport (>= 3.2)
axlsx (~> 2.0)
coffee-rails
fog (~> 1.23)

PATH
remote: ./adhoq-rails
specs:
adhoq-rails (0.1.0)
active_decorator
adhoq-core
coffee-rails
font-awesome-sass (~> 4.2.0)
jquery-rails
rails (>= 3.2)
railties (>= 3.2)
rouge
sass-rails
slim-rails
Expand Down Expand Up @@ -143,7 +158,7 @@ GEM
fog-ecloud (0.3.0)
fog-core
fog-xml
fog-google (0.0.7)
fog-google (0.0.9)
fog-core
fog-json
fog-xml
Expand Down Expand Up @@ -215,19 +230,19 @@ GEM
method_source (0.8.2)
mime-types (2.6.2)
mini_portile (0.6.2)
minitest (5.8.0)
minitest (5.8.1)
multi_json (1.11.2)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (2.9.2)
net-ssh (3.0.1)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
poltergeist (1.6.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
pry (0.10.1)
pry (0.10.2)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
Expand All @@ -237,17 +252,6 @@ GEM
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.4)
actionmailer (= 4.2.4)
actionpack (= 4.2.4)
actionview (= 4.2.4)
activejob (= 4.2.4)
activemodel (= 4.2.4)
activerecord (= 4.2.4)
activesupport (= 4.2.4)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.4)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
Expand Down Expand Up @@ -306,8 +310,8 @@ GEM
railties (>= 3.1, < 5.0)
slim (~> 3.0)
slop (3.6.0)
sprockets (3.3.4)
rack (~> 1.0)
sprockets (3.3.5)
rack (> 1, < 3)
sprockets-rails (2.3.3)
actionpack (>= 3.0)
activesupport (>= 3.0)
Expand All @@ -332,6 +336,8 @@ PLATFORMS

DEPENDENCIES
adhoq!
adhoq-core!
adhoq-rails!
capybara (~> 2.4.3)
codeclimate-test-reporter
database_cleaner
Expand All @@ -345,4 +351,4 @@ DEPENDENCIES
tapp

BUNDLED WITH
1.10.3
1.10.6
42 changes: 20 additions & 22 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
require "bundler/gem_tasks"

require 'rdoc/task'
root = File.expand_path("../", __FILE__)
subprojects = %w(adhoq-core adhoq-rails)

RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Adhoq'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('lib/**/*.rb')
subprojects.each do |prj|
namespace prj do
desc "Run specs of #{prj}"
task :spec do
Bundler.with_clean_env do
Dir.chdir(File.join(root, prj))
bundle_gemfile = ENV["RAILS_VERSION"] ?
"gemfiles/Gemfile-rails-#{ENV["RAILS_VERSION"]}.x" :
"./Gemfile"
sh "BUNDLE_GEMFILE=#{bundle_gemfile} bundle install --jobs=3 --retry=3 --path=.bundle"
sh "BUNDLE_GEMFILE=#{bundle_gemfile} bundle exec rake spec"
end
end
end
end

APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
load 'rails/tasks/engine.rake'

require 'rspec/core'
require 'rspec/core/rake_task'
desc "Run all specs in spec directory (excluding plugin specs)"
RSpec::Core::RakeTask.new
spec_target = ENV["SUBPROJECT"] || "adhoq-core"
desc "Run specs selected by ENV['SUBPROJECT'] (default adhoq-core)"
task spec: ["#{spec_target}:spec"]

task default: :spec

Bundler::GemHelper.install_tasks

10 changes: 10 additions & 0 deletions adhoq-core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.bundle/
/.yardoc
/Gemfile.lock
/_yardoc/
/coverage/
/doc/
/pkg/
/spec/reports/
/tmp/
gemfiles/Gemfile-*.lock
2 changes: 2 additions & 0 deletions adhoq-core/.rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--require spec_helper
4 changes: 4 additions & 0 deletions adhoq-core/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: ruby
rvm:
- 2.2.3
before_install: gem install bundler -v 1.10.6
4 changes: 4 additions & 0 deletions adhoq-core/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in adhoq-core.gemspec
gemspec
36 changes: 36 additions & 0 deletions adhoq-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Adhoq::Core

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/adhoq/core`. To experiment with that code, run `bin/console` for an interactive prompt.

TODO: Delete this and the text above, and describe your gem

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'adhoq-core'
```

And then execute:

$ bundle

Or install it yourself as:

$ gem install adhoq-core

## Usage

TODO: Write usage instructions here

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/adhoq-core.

8 changes: 8 additions & 0 deletions adhoq-core/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require "bundler/gem_tasks"

require 'rspec/core'
require 'rspec/core/rake_task'
desc "Run all specs in spec directory (excluding plugin specs)"
RSpec::Core::RakeTask.new

task default: :spec
36 changes: 36 additions & 0 deletions adhoq-core/adhoq-core.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
$:.push File.expand_path("../lib", __FILE__)

# Maintain your gem's version:
require "adhoq/core/version"

# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "adhoq-core"
s.version = Adhoq::Core::VERSION
s.authors = ['Kyosuke MOROHASHI', 'Tomohiro Hashidate']
s.email = ['[email protected]']
s.homepage = 'https://github.com/esminc/adhoq'
s.summary = 'DB management console in the wild.'
s.description = 'generate instant reports from adhoc SQL query.'
s.license = "MIT"

s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
s.bindir = "exe"
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
s.require_paths = ["lib"]

s.add_dependency 'axlsx', '~> 2.0'
s.add_dependency 'fog', '~> 1.23'
s.add_dependency 'activesupport', '>= 3.2'
s.add_dependency 'activerecord', '>= 3.2'

s.add_development_dependency 'database_cleaner'
s.add_development_dependency 'factory_girl_rails'
s.add_development_dependency 'pry-byebug'
s.add_development_dependency 'rspec-rails'
s.add_development_dependency 'simple_xlsx_reader'
s.add_development_dependency 'sqlite3'
s.add_development_dependency 'tapp'

s.test_files = Dir['spec/{adhoq,factories,models,support}/**/*', 'spec/spec_helper.rb']
end
14 changes: 14 additions & 0 deletions adhoq-core/bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env ruby

require "bundler/setup"
require "adhoq/core"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

# (If you use this, don't forget to add pry to your Gemfile!)
# require "pry"
# Pry.start

require "irb"
IRB.start
7 changes: 7 additions & 0 deletions adhoq-core/bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'

bundle install

# Do any other automated setup that you need to do here
11 changes: 11 additions & 0 deletions adhoq-core/gemfiles/Gemfile-rails-3.2.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
source 'http://rubygems.org'

gemspec path: '..'

gem 'activerecord', '~> 3.2.0'

gem 'test-unit'

group :test do
gem 'codeclimate-test-reporter', require: false
end
8 changes: 8 additions & 0 deletions adhoq-core/gemfiles/Gemfile-rails-4.0.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'http://rubygems.org'

gemspec path: '..'

gem 'activerecord', '~> 4.0.0'
group :test do
gem 'codeclimate-test-reporter', require: false
end
8 changes: 8 additions & 0 deletions adhoq-core/gemfiles/Gemfile-rails-4.1.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'http://rubygems.org'

gemspec path: '..'

gem 'activerecord', '~> 4.1.0'
group :test do
gem 'codeclimate-test-reporter', require: false
end
8 changes: 8 additions & 0 deletions adhoq-core/gemfiles/Gemfile-rails-4.2.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'http://rubygems.org'

gemspec path: '..'

gem 'activerecord', '~> 4.2.0'
group :test do
gem 'codeclimate-test-reporter', require: false
end
19 changes: 19 additions & 0 deletions adhoq-core/lib/adhoq-core.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'active_record'
require 'adhoq/global_variable'

module Adhoq
autoload 'AdhocExecution', 'adhoq/adhoc_execution'
autoload 'Configuration', 'adhoq/configuration'
autoload 'Error', 'adhoq/error'
autoload 'Executor', 'adhoq/executor'
autoload 'Reporter', 'adhoq/reporter'
autoload 'Result', 'adhoq/result'
autoload 'Storage', 'adhoq/storage'

extend Adhoq::GlobalVariable

configure do |config|
config.authorization = proc { true }
config.database_connection = proc { ActiveRecord::Base.connection }
end
end
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'active_support/configurable'

# see https://github.com/amatsuda/kaminari/blob/master/lib/kaminari/config.rb
module Adhoq
class Configuration
Expand Down
4 changes: 4 additions & 0 deletions adhoq-core/lib/adhoq/core.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Adhoq
module Core
end
end
5 changes: 5 additions & 0 deletions adhoq-core/lib/adhoq/core/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Adhoq
module Core
VERSION = "0.1.0"
end
end
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading