cequel 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Appraisals +12 -0
- data/CHANGELOG.md +239 -0
- data/CONTRIBUTING.md +65 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +162 -0
- data/LICENSE +19 -0
- data/README.md +525 -0
- data/Rakefile +122 -0
- data/Vagrantfile +146 -0
- data/lib/cequel/record/railtie.rb +2 -0
- data/lib/cequel/version.rb +1 -1
- data/templates/config/cequel.yml +19 -0
- metadata +12 -2
data/Rakefile
ADDED
@@ -0,0 +1,122 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
require 'rubocop/rake_task'
|
5
|
+
require 'appraisal'
|
6
|
+
require File.expand_path('../lib/cequel/version', __FILE__)
|
7
|
+
|
8
|
+
RUBY_VERSIONS = YAML.load_file(File.expand_path('../.travis.yml', __FILE__))['rvm']
|
9
|
+
|
10
|
+
task :default => :release
|
11
|
+
task :release => [
|
12
|
+
:verify_changelog,
|
13
|
+
:rubocop,
|
14
|
+
:"test:all",
|
15
|
+
:build,
|
16
|
+
:tag,
|
17
|
+
:update_stable,
|
18
|
+
:push,
|
19
|
+
:cleanup
|
20
|
+
]
|
21
|
+
|
22
|
+
desc 'Build gem'
|
23
|
+
task :build do
|
24
|
+
system 'gem build cequel.gemspec'
|
25
|
+
end
|
26
|
+
|
27
|
+
desc 'Create git release tag'
|
28
|
+
task :tag do
|
29
|
+
system "git tag -a -m 'Version #{Cequel::VERSION}' #{Cequel::VERSION}"
|
30
|
+
system "git push git@github.com:cequel/cequel.git #{Cequel::VERSION}:#{Cequel::VERSION}"
|
31
|
+
end
|
32
|
+
|
33
|
+
desc 'Update stable branch on GitHub'
|
34
|
+
task :update_stable do
|
35
|
+
if Cequel::VERSION =~ /^(\d+\.)+\d+$/ # Don't push for prerelease
|
36
|
+
system "git push -f origin HEAD:stable"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
desc 'Push gem to repository'
|
41
|
+
task :push do
|
42
|
+
system "gem push cequel-#{Cequel::VERSION}.gem"
|
43
|
+
end
|
44
|
+
|
45
|
+
task 'Remove packaged gems'
|
46
|
+
task :cleanup do
|
47
|
+
system "rm -v *.gem"
|
48
|
+
end
|
49
|
+
|
50
|
+
desc 'Run the specs'
|
51
|
+
RSpec::Core::RakeTask.new(:test) do |t|
|
52
|
+
t.pattern = './spec/examples/**/*_spec.rb'
|
53
|
+
t.rspec_opts = '-b'
|
54
|
+
end
|
55
|
+
|
56
|
+
namespace :bundle do
|
57
|
+
desc 'Run bundler for all environments'
|
58
|
+
task :all do
|
59
|
+
abort unless all_rubies('bundle')
|
60
|
+
abort unless all_rubies('rake', 'appraisal:install')
|
61
|
+
end
|
62
|
+
|
63
|
+
desc 'Update to latest dependencies on all environments'
|
64
|
+
task :update_all do
|
65
|
+
gemfiles = File.expand_path("../gemfiles", __FILE__)
|
66
|
+
FileUtils.rm_r(gemfiles, :verbose => true) if File.exist?(gemfiles)
|
67
|
+
abort unless system('bundle', 'update')
|
68
|
+
abort unless all_rubies('bundle')
|
69
|
+
abort unless all_rubies('rake', 'appraisal:install')
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
desc 'Check style with Rubocop'
|
74
|
+
Rubocop::RakeTask.new(:rubocop) do |task|
|
75
|
+
task.patterns = ['lib/**/*.rb']
|
76
|
+
task.formatters = ['files']
|
77
|
+
task.fail_on_error = true
|
78
|
+
end
|
79
|
+
|
80
|
+
namespace :test do
|
81
|
+
desc 'Run the specs with progress formatter'
|
82
|
+
RSpec::Core::RakeTask.new(:concise) do |t|
|
83
|
+
t.pattern = './spec/examples/**/*_spec.rb'
|
84
|
+
t.rspec_opts = '--fail-fast --format=progress'
|
85
|
+
t.fail_on_error = true
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
namespace :test do
|
90
|
+
task :all do
|
91
|
+
abort unless all_rubies('rake', 'appraisal', 'test:concise')
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
desc 'Update changelog'
|
96
|
+
task :changelog do
|
97
|
+
require './lib/cequel/version.rb'
|
98
|
+
|
99
|
+
last_tag = `git tag`.each_line.map(&:strip).last
|
100
|
+
existing_changelog = File.read('./CHANGELOG.md')
|
101
|
+
File.open('./CHANGELOG.md', 'w') do |f|
|
102
|
+
f.puts "## #{Cequel::VERSION}"
|
103
|
+
f.puts ""
|
104
|
+
f.puts `git log --no-merges --pretty=format:'* %s' #{last_tag}..`
|
105
|
+
f.puts ""
|
106
|
+
f.puts existing_changelog
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
task :verify_changelog do
|
111
|
+
require './lib/cequel/version.rb'
|
112
|
+
|
113
|
+
if File.read('./CHANGELOG.md').each_line.first.strip != "## #{Cequel::VERSION}"
|
114
|
+
abort "Changelog is not up-to-date."
|
115
|
+
end
|
116
|
+
end
|
117
|
+
|
118
|
+
def all_rubies(*command)
|
119
|
+
!RUBY_VERSIONS.find do |version|
|
120
|
+
!system('rvm', version, 'do', *command)
|
121
|
+
end
|
122
|
+
end
|
data/Vagrantfile
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
5
|
+
VAGRANTFILE_API_VERSION = "2"
|
6
|
+
|
7
|
+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
8
|
+
# All Vagrant configuration is done here. The most common configuration
|
9
|
+
# options are documented and commented below. For a complete reference,
|
10
|
+
# please see the online documentation at vagrantup.com.
|
11
|
+
|
12
|
+
# Every Vagrant virtual environment requires a box to build off of.
|
13
|
+
config.vm.box = "precise64"
|
14
|
+
|
15
|
+
# The url from where the 'config.vm.box' box will be fetched if it
|
16
|
+
# doesn't already exist on the user's system.
|
17
|
+
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
|
18
|
+
|
19
|
+
# Create a forwarded port mapping which allows access to a specific port
|
20
|
+
# within the machine from a port on the host machine. In the example below,
|
21
|
+
# accessing "localhost:8080" will access port 80 on the guest machine.
|
22
|
+
# config.vm.network :forwarded_port, guest: 80, host: 8080
|
23
|
+
|
24
|
+
# Create a private network, which allows host-only access to the machine
|
25
|
+
# using a specific IP.
|
26
|
+
# config.vm.network :private_network, ip: "192.168.33.10"
|
27
|
+
|
28
|
+
# Create a public network, which generally matched to bridged network.
|
29
|
+
# Bridged networks make the machine appear as another physical device on
|
30
|
+
# your network.
|
31
|
+
# config.vm.network :public_network
|
32
|
+
|
33
|
+
# If true, then any SSH connections made will enable agent forwarding.
|
34
|
+
# Default value: false
|
35
|
+
# config.ssh.forward_agent = true
|
36
|
+
|
37
|
+
# Share an additional folder to the guest VM. The first argument is
|
38
|
+
# the path on the host to the actual folder. The second argument is
|
39
|
+
# the path on the guest to mount the folder. And the optional third
|
40
|
+
# argument is a set of non-required options.
|
41
|
+
config.vm.synced_folder ".", "/vagrant", disabled: true
|
42
|
+
|
43
|
+
# Provider-specific configuration so you can fine-tune various
|
44
|
+
# backing providers for Vagrant. These expose provider-specific options.
|
45
|
+
# Example for VirtualBox:
|
46
|
+
#
|
47
|
+
# config.vm.provider :virtualbox do |vb|
|
48
|
+
# # Don't boot with headless mode
|
49
|
+
# vb.gui = true
|
50
|
+
#
|
51
|
+
# # Use VBoxManage to customize the VM. For example to change memory:
|
52
|
+
# vb.customize ["modifyvm", :id, "--memory", "1024"]
|
53
|
+
# end
|
54
|
+
#
|
55
|
+
# View the documentation for the provider you're using for more
|
56
|
+
# information on available options.
|
57
|
+
|
58
|
+
# Enable provisioning with Puppet stand alone. Puppet manifests
|
59
|
+
# are contained in a directory path relative to this Vagrantfile.
|
60
|
+
# You will need to create the manifests directory and a manifest in
|
61
|
+
# the file base.pp in the manifests_path directory.
|
62
|
+
#
|
63
|
+
# An example Puppet manifest to provision the message of the day:
|
64
|
+
#
|
65
|
+
# # group { "puppet":
|
66
|
+
# # ensure => "present",
|
67
|
+
# # }
|
68
|
+
# #
|
69
|
+
# # File { owner => 0, group => 0, mode => 0644 }
|
70
|
+
# #
|
71
|
+
# # file { '/etc/motd':
|
72
|
+
# # content => "Welcome to your Vagrant-built virtual machine!
|
73
|
+
# # Managed by Puppet.\n"
|
74
|
+
# # }
|
75
|
+
#
|
76
|
+
# config.vm.provision :puppet do |puppet|
|
77
|
+
# puppet.manifests_path = "manifests"
|
78
|
+
# puppet.manifest_file = "site.pp"
|
79
|
+
# end
|
80
|
+
|
81
|
+
# Enable provisioning with chef solo, specifying a cookbooks path, roles
|
82
|
+
# path, and data_bags path (all relative to this Vagrantfile), and adding
|
83
|
+
# some recipes and/or roles.
|
84
|
+
#
|
85
|
+
# config.vm.provision :chef_solo do |chef|
|
86
|
+
# chef.cookbooks_path = "../my-recipes/cookbooks"
|
87
|
+
# chef.roles_path = "../my-recipes/roles"
|
88
|
+
# chef.data_bags_path = "../my-recipes/data_bags"
|
89
|
+
# chef.add_recipe "mysql"
|
90
|
+
# chef.add_role "web"
|
91
|
+
#
|
92
|
+
# # You may also specify custom JSON attributes:
|
93
|
+
# chef.json = { :mysql_password => "foo" }
|
94
|
+
# end
|
95
|
+
|
96
|
+
# Enable provisioning with chef server, specifying the chef server URL,
|
97
|
+
# and the path to the validation key (relative to this Vagrantfile).
|
98
|
+
#
|
99
|
+
# The Opscode Platform uses HTTPS. Substitute your organization for
|
100
|
+
# ORGNAME in the URL and validation key.
|
101
|
+
#
|
102
|
+
# If you have your own Chef Server, use the appropriate URL, which may be
|
103
|
+
# HTTP instead of HTTPS depending on your configuration. Also change the
|
104
|
+
# validation key to validation.pem.
|
105
|
+
#
|
106
|
+
# config.vm.provision :chef_client do |chef|
|
107
|
+
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
|
108
|
+
# chef.validation_key_path = "ORGNAME-validator.pem"
|
109
|
+
# end
|
110
|
+
#
|
111
|
+
# If you're using the Opscode platform, your validator client is
|
112
|
+
# ORGNAME-validator, replacing ORGNAME with your organization name.
|
113
|
+
#
|
114
|
+
# If you have your own Chef Server, the default validation client name is
|
115
|
+
# chef-validator, unless you changed the configuration.
|
116
|
+
#
|
117
|
+
# chef.validation_client_name = "ORGNAME-validator"
|
118
|
+
provision = <<-SH
|
119
|
+
set -e
|
120
|
+
apt-get update
|
121
|
+
apt-get upgrade -y
|
122
|
+
apt-get autoremove -y
|
123
|
+
add-apt-repository -y ppa:webupd8team/java
|
124
|
+
apt-get update
|
125
|
+
echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
|
126
|
+
echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
|
127
|
+
apt-get install -y oracle-java$2-installer oracle-java$2-set-default
|
128
|
+
curl -s http://archive.apache.org/dist/cassandra/$1/apache-cassandra-$1-bin.tar.gz | tar -C /opt -xzvf -
|
129
|
+
echo "start on runlevel [2345]
|
130
|
+
stop on runlevel [06]
|
131
|
+
exec /opt/apache-cassandra-$1/bin/cassandra" > /etc/init/cassandra.conf
|
132
|
+
sed -i -e 's/rpc_address:.*/rpc_address: 0.0.0.0/' /opt/apache-cassandra-$1/conf/cassandra.yaml
|
133
|
+
service cassandra start
|
134
|
+
SH
|
135
|
+
|
136
|
+
%w(2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.2.13 1.2.12 1.2.11 1.2.10 1.2.9 1.2.8
|
137
|
+
1.2.7 1.2.6 1.2.5 1.2.4 1.2.3 1.2.2 1.2.1 1.2.0).each do |version|
|
138
|
+
java_version = version =~ /^1/ ? '6' : '7'
|
139
|
+
config.vm.define version do |machine|
|
140
|
+
machine.vm.provision :shell, inline: provision,
|
141
|
+
args: [version, java_version]
|
142
|
+
machine.vm.network :forwarded_port, guest: 9160, host: 9160,
|
143
|
+
auto_correct: true
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
data/lib/cequel/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
<% app_name = Cequel::Record::Railtie.app_name -%>
|
2
|
+
development:
|
3
|
+
host: '127.0.0.1:9160'
|
4
|
+
keyspace: <%= app_name %>_development
|
5
|
+
|
6
|
+
test:
|
7
|
+
host: '127.0.0.1:9160'
|
8
|
+
keyspace: <%= app_name %>_test
|
9
|
+
|
10
|
+
production:
|
11
|
+
hosts:
|
12
|
+
- 'cass1.<%= app_name %>.biz:9160'
|
13
|
+
- 'cass2.<%= app_name %>.biz:9160'
|
14
|
+
- 'cass3.<%= app_name %>.biz:9160'
|
15
|
+
keyspace: <%= app_name %>_production
|
16
|
+
thrift:
|
17
|
+
retries: 10
|
18
|
+
timeout: 15
|
19
|
+
connect_timeout: 15
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat Brown
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-
|
15
|
+
date: 2014-03-05 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|
@@ -164,6 +164,15 @@ executables: []
|
|
164
164
|
extensions: []
|
165
165
|
extra_rdoc_files: []
|
166
166
|
files:
|
167
|
+
- Appraisals
|
168
|
+
- CHANGELOG.md
|
169
|
+
- CONTRIBUTING.md
|
170
|
+
- Gemfile
|
171
|
+
- Gemfile.lock
|
172
|
+
- LICENSE
|
173
|
+
- README.md
|
174
|
+
- Rakefile
|
175
|
+
- Vagrantfile
|
167
176
|
- lib/cequel.rb
|
168
177
|
- lib/cequel/errors.rb
|
169
178
|
- lib/cequel/metal.rb
|
@@ -252,6 +261,7 @@ files:
|
|
252
261
|
- spec/shared/readable_dictionary.rb
|
253
262
|
- spec/support/helpers.rb
|
254
263
|
- spec/support/result_stub.rb
|
264
|
+
- templates/config/cequel.yml
|
255
265
|
- templates/record.rb
|
256
266
|
homepage: https://github.com/cequel/cequel
|
257
267
|
licenses:
|