xnlogic 1.0.26 → 1.0.27

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: abf49c48ec81cbce10678603bf136f6f93147dcd
4
- data.tar.gz: 29f457b0595c5510235538a4218bd171ed6cc1b1
3
+ metadata.gz: cf97ed46cfcde7bf61a82e58f813e43806ab9f28
4
+ data.tar.gz: eedfa2f846dcfa2d98baa6ef698e9b4816c583d3
5
5
  SHA512:
6
- metadata.gz: 1274b810da1a3fde1473ff191592cef9da7efa1281c2570906bb9818eb2ada7d90ac6ddeeef1fbc88907b40d08a709ebc7abcdf00765405f6219d154215abc0f
7
- data.tar.gz: 9c56d36754200b2651eb2cda9cdb004a91156dc91cbd70624fdb1ca2dd3013b582c4f94632e9323b82bd390ea68ea83400a5f193b8050d7c047601744d7e6a63
6
+ metadata.gz: 22e4d7ee0ceaaf4e8994726242b7591dd41561d8d8449d6ba1b91ef47133e0f3a1cfe38dec9bd17fd3ffbad5301d2c599d2cf69ec76081c9e36a468f4c1e7f71
7
+ data.tar.gz: 4820d95814688eb95a76c703b63720b07ca4532740841907766824fa3caffeb8bf8d09016de8f9455dd3e46637fe2b57dadb5de79c14da9edc88a8d31e0c67c8
data/README.md CHANGED
@@ -9,7 +9,7 @@ Bootstrap your xnlogic.com application with this easy to use executable gem.
9
9
 
10
10
  ## Usage
11
11
 
12
- $ xnlogic application my_app
12
+ $ xnlogic application my_app --key xnuser:xnpassword
13
13
  $ cd my_app
14
14
  $ vagrant up
15
15
  $ vagrant ssh
@@ -19,6 +19,11 @@ From the Vagrant VM, you can then:
19
19
  $ xn-server
20
20
  $ xn-console
21
21
 
22
+ ## Development
23
+
24
+ To execute from your checked out development version, run it as follows:
25
+
26
+ ruby -I ~/dev/xnlogic/lib ~/dev/xnlogic/bin/xnlogic vm_config
22
27
 
23
28
  ## Contributing
24
29
 
@@ -4,6 +4,11 @@ module Xnlogic
4
4
  class CLI::Application < CLI::Core
5
5
  attr_reader :app_name, :base_name, :name, :root
6
6
 
7
+ def initialize(options, thor)
8
+ super
9
+ @ignore_options = ['up', 'provision']
10
+ end
11
+
7
12
  def set_name(app_name)
8
13
  if File.exists?(options_filename)
9
14
  Xnlogic.ui.info "Can not create an application within an application."
@@ -56,15 +61,26 @@ module Xnlogic
56
61
  generate_application
57
62
  write_options
58
63
  Xnlogic.ui.info "Initializing git repo in #{app}"
59
- Dir.chdir(app) { `git init`; `git add .` }
64
+ Dir.chdir(app) { system 'git init' and system 'git add .' }
60
65
 
61
66
  install_vagrant_note
67
+ if options['up']
68
+ Dir.chdir(app) { system 'vagrant up' }
69
+ else
70
+ Xnlogic.ui.info ""
71
+ Xnlogic.ui.info "To start your VM, run the following:"
72
+ Xnlogic.ui.info ""
73
+ Xnlogic.ui.info "cd #{root}"
74
+ Xnlogic.ui.info "xnlogic up"
75
+ end
76
+
77
+ if options['provision']
78
+ Dir.chdir(app) { system 'vagrant provision' }
79
+ end
80
+
81
+ Xnlogic.ui.info "To begin working with your VM, ssh into it with the following command:"
62
82
  Xnlogic.ui.info ""
63
- Xnlogic.ui.info "To start your VM, run the following:"
64
- Xnlogic.ui.info ""
65
- Xnlogic.ui.info "cd #{root}"
66
- Xnlogic.ui.info "vagrant up"
67
- Xnlogic.ui.info "vagrant ssh"
83
+ Xnlogic.ui.info "xnlogic ssh"
68
84
  Xnlogic.ui.info ""
69
85
  Xnlogic.ui.info "Once logged in to the server, try the xn-console and xn-server commands"
70
86
  end
@@ -73,11 +89,17 @@ module Xnlogic
73
89
  generate_vm_config
74
90
  write_options
75
91
  install_vagrant_note
76
- Xnlogic.ui.info ""
77
- Xnlogic.ui.info "If you have an existing VM that you are updating, run 'vagrant provision',"
78
- Xnlogic.ui.info "otherwise, run 'vagrant up'"
79
- Xnlogic.ui.info ""
80
- Xnlogic.ui.info "Once that is done, run 'vagrant ssh' to log in to the VM."
92
+
93
+ if options['provision'] or options['up']
94
+ Dir.chdir(app) { system 'vagrant up' } if options['up']
95
+ Dir.chdir(app) { system 'vagrant provision' } if options['provision']
96
+ else
97
+ Xnlogic.ui.info ""
98
+ Xnlogic.ui.info "If you have an existing VM that you are updating, run 'xnlogic provision',"
99
+ Xnlogic.ui.info "otherwise, run 'xnlogic up'"
100
+ Xnlogic.ui.info ""
101
+ end
102
+ Xnlogic.ui.info "Once that is done, run 'xnlogic ssh' to log in to the VM."
81
103
  end
82
104
 
83
105
  def install_vagrant_note
@@ -112,6 +134,7 @@ module Xnlogic
112
134
  opts = template_options
113
135
  base_templates = {
114
136
  "Vagrantfile.tt" => "Vagrantfile",
137
+ "Gemfile.tt" => "Gemfile",
115
138
  "config/vagrant.provision.tt" => "config/vagrant.provision",
116
139
  "config/datomic.conf" => "config/datomic.conf",
117
140
  "config/transactor.properties" => "config/transactor.properties",
@@ -132,7 +155,6 @@ module Xnlogic
132
155
  "gitignore.tt" => ".gitignore",
133
156
  ".rspec.tt" => ".rspec",
134
157
  "gemspec.tt" => "#{namespaced_path}.gemspec",
135
- "Gemfile.tt" => "Gemfile",
136
158
  "Rakefile.tt" => "Rakefile",
137
159
  "Readme.md.tt" => "Readme.md",
138
160
  "config.ru.tt" => "config.ru",
@@ -3,9 +3,10 @@ require 'yaml'
3
3
 
4
4
  module Xnlogic
5
5
  class CLI::Core
6
- attr_reader :options, :thor, :app
6
+ attr_reader :options, :thor, :app, :ignore_options
7
7
 
8
8
  def initialize(options, thor)
9
+ @ignore_options ||= []
9
10
  @options = {}.merge options
10
11
  @thor = thor
11
12
  @app = Pathname.pwd
@@ -24,8 +25,12 @@ module Xnlogic
24
25
 
25
26
  def write_options
26
27
  Dir.mkdir(app.join('config')) unless app.join('config').exist?
28
+ opts = options.clone
29
+ ignore_options.each do |x|
30
+ opts.delete x
31
+ end
27
32
  File.open(options_file.to_s, 'w') do |f|
28
- f.puts YAML.dump options
33
+ f.puts YAML.dump opts
29
34
  end
30
35
  end
31
36
  end
data/lib/xnlogic/cli.rb CHANGED
@@ -65,6 +65,10 @@ module Xnlogic
65
65
  "Amount of RAM to allow the Development VM to use (default 2048, in MB)"
66
66
  method_option "root", type: :string, banner:
67
67
  "Optionally specify a different root directory name"
68
+ method_option "provision", type: :boolean, banner:
69
+ "Update the VM with the new provisioning settings"
70
+ method_option "up", type: :boolean, banner:
71
+ "Start the the VM (will provision automatically only on the first run)"
68
72
  end
69
73
 
70
74
  desc "application [NAME] [OPTIONS]", <<EOD
@@ -95,14 +99,6 @@ EOD
95
99
  Application.new(options, self).in_existing_project.vm_config
96
100
  end
97
101
 
98
- desc "deployment [OPTIONS]", "Adds Vagrant configuration to the current project"
99
- vm_config_options
100
- method_option "name", type: :string, banner:
101
- def deployment
102
- Application.new(options, self).in_existing_project.deployment
103
- end
104
-
105
-
106
102
  desc "gem_sources [OPTIONS]", "Show the gem source URLs as configured in the current application"
107
103
  method_option "key", type: :string, banner:
108
104
  "You must supply an XN key to be able to download the proprietary dependencies needed to boot your application"
@@ -114,6 +110,20 @@ EOD
114
110
  app.show_source "https://#{app.options['key']}@gems.xnlogic.com/"
115
111
  end
116
112
 
113
+ desc "up", "Start the VM (and provision only on the first run)"
114
+ def up
115
+ system 'vagrant up'
116
+ end
117
+
118
+ desc "provision", "Update the VM with the current provisioning settings"
119
+ def provision
120
+ system 'vagrant provision'
121
+ end
122
+
123
+ desc "ssh", "ssh into the VM"
124
+ def ssh
125
+ exec 'vagrant ssh'
126
+ end
117
127
 
118
128
  desc "server_profile HOSTNAME [OPTIONS]",
119
129
  "Generate a new server profile"
@@ -13,7 +13,10 @@
13
13
  Example:
14
14
  .
15
15
  .P
16
- xnlogic application my_app \-\-key my_xn_user:password
16
+ xnlogic application my_app \-\-key my_xn_user:password \-\-up
17
+ .
18
+ .P
19
+ xnlogic help application
17
20
  .
18
21
  .SH "DESCRIPTION"
19
22
  XN Logic is a graph database\-backed application framework\.
@@ -37,12 +40,24 @@ Create a simple application, suitable for development with the XN Framework\.
37
40
  Updates an existing application with the current Vagrant VM configuration, or can also be used to adjust settings\.
38
41
  .
39
42
  .TP
40
- \fBxnlogic deployment(1)\fR
41
- Generates deployment files in an existing application\.
43
+ \fBxnlogic server_profile(1)\fR
44
+ Generates a server profile that can be used to configure a production deployment\.
42
45
  .
43
46
  .SH "UTILITY COMMANDS"
44
47
  .
45
48
  .TP
49
+ \fBxnlogic up(1)\fR
50
+ Starts the development VM\. On the first run (only) it will also provision it\.
51
+ .
52
+ .TP
53
+ \fBxnlogic ssh(1)\fR
54
+ Interactively log into the development VM\.
55
+ .
56
+ .TP
57
+ \fBxnlogic provision(1)\fR
58
+ Update a running VM\'s configuration to match the config/vagrant\.provision script\.
59
+ .
60
+ .TP
46
61
  \fBxnlogic gem_sources(1)\fR
47
62
  Displays the gem sources needed by this application
48
63
  .
@@ -51,7 +66,7 @@ Displays the gem sources needed by this application
51
66
  Displays detailed help for each subcommand
52
67
  .
53
68
  .TP
54
- \fBxnlogic version\fR
69
+ \fBxnlogic version(1)\fR
55
70
  Print the version of the xnlogic command\-line tools\.
56
71
  .
57
72
  .SH "OPTIONS"
@@ -10,7 +10,9 @@ SYNOPSIS
10
10
 
11
11
  Example:
12
12
 
13
- xnlogic application my_app --key my_xn_user:password
13
+ xnlogic application my_app --key my_xn_user:password --up
14
+
15
+ xnlogic help application
14
16
 
15
17
  DESCRIPTION
16
18
  XN Logic is a graph database-backed application framework.
@@ -32,17 +34,29 @@ APPLICATION UPDATES
32
34
  Updates an existing application with the current Vagrant VM con-
33
35
  figuration, or can also be used to adjust settings.
34
36
 
35
- xnlogic deployment(1)
36
- Generates deployment files in an existing application.
37
+ xnlogic server_profile(1)
38
+ Generates a server profile that can be used to configure a pro-
39
+ duction deployment.
37
40
 
38
41
  UTILITY COMMANDS
42
+ xnlogic up(1)
43
+ Starts the development VM. On the first run (only) it will also
44
+ provision it.
45
+
46
+ xnlogic ssh(1)
47
+ Interactively log into the development VM.
48
+
49
+ xnlogic provision(1)
50
+ Update a running VM's configuration to match the con-
51
+ fig/vagrant.provision script.
52
+
39
53
  xnlogic gem_sources(1)
40
54
  Displays the gem sources needed by this application
41
55
 
42
56
  xnlogic help(1)
43
57
  Displays detailed help for each subcommand
44
58
 
45
- xnlogic version
59
+ xnlogic version(1)
46
60
  Print the version of the xnlogic command-line tools.
47
61
 
48
62
  OPTIONS
@@ -0,0 +1,13 @@
1
+ <% if config[:xn_key] -%>
2
+ source "https://<%= config[:xn_key] %>@gems.xnlogic.com"
3
+ <% else -%>
4
+ puts "No key found. You must set the key by running:"
5
+ puts " xnlogic vm_config --key <your key>"
6
+ puts "then try again."
7
+ exit 1
8
+ <% end -%>
9
+ source "https://rubygems.org/"
10
+
11
+ gemspec
12
+
13
+ eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom')
@@ -20,9 +20,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
20
20
  # Create a forwarded port mapping which allows access to a specific port
21
21
  # within the machine from a port on the host machine. In the example below,
22
22
  # accessing "localhost:8080" will access port 80 on the guest machine.
23
- config.vm.network "forwarded_port", guest: 8080, host: 8080
24
- config.vm.network "forwarded_port", guest: 3030, host: 3030
25
- config.vm.network "forwarded_port", guest: 3031, host: 3031
23
+ # config.vm.network "forwarded_port", guest: 8080, host: 8080
26
24
 
27
25
  # Create a private network, which allows host-only access to the machine
28
26
  # using a specific IP.
@@ -36,7 +36,14 @@ silent sudo dpkg-reconfigure --frontend noninteractive tzdata
36
36
  hr
37
37
  echo "Configuring XN gems"
38
38
  hr
39
- gem sources --add https://<%= config[:xn_key] || 'xn:key_required' %>@gems.xnlogic.com/
39
+
40
+ <% if config[:xn_key] -%>
41
+ silent gem sources --add https://<%= config[:xn_key] %>@gems.xnlogic.com/
42
+ <% else -%>
43
+ echo "No key found. You must set the key by running:"
44
+ echo " xnlogic vm_config --key <your key> --provision"
45
+ exit 1
46
+ <% end -%>
40
47
 
41
48
  hr
42
49
  echo "Configuring XN"
@@ -1,3 +1,3 @@
1
1
  module Xnlogic
2
- VERSION = "1.0.26"
2
+ VERSION = "1.0.27"
3
3
  end
data/man/xnlogic.ronn CHANGED
@@ -7,7 +7,9 @@ xnlogic(1) -- XN Logic Command-line Tools
7
7
 
8
8
  Example:
9
9
 
10
- xnlogic application my_app --key my_xn_user:password
10
+ xnlogic application my_app --key my_xn_user:password --up
11
+
12
+ xnlogic help application
11
13
 
12
14
  ## DESCRIPTION
13
15
 
@@ -32,18 +34,27 @@ We divide `xnlogic` subcommands into the initial command, update commands, and u
32
34
  Updates an existing application with the current Vagrant VM configuration, or
33
35
  can also be used to adjust settings.
34
36
 
35
- * `xnlogic deployment(1)`:
36
- Generates deployment files in an existing application.
37
+ * `xnlogic server_profile(1)`:
38
+ Generates a server profile that can be used to configure a production deployment.
37
39
 
38
40
  ## UTILITY COMMANDS
39
41
 
42
+ * `xnlogic up(1)`:
43
+ Starts the development VM. On the first run (only) it will also provision it.
44
+
45
+ * `xnlogic ssh(1)`:
46
+ Interactively log into the development VM.
47
+
48
+ * `xnlogic provision(1)`:
49
+ Update a running VM's configuration to match the config/vagrant.provision script.
50
+
40
51
  * `xnlogic gem_sources(1)`:
41
52
  Displays the gem sources needed by this application
42
53
 
43
54
  * `xnlogic help(1)`:
44
55
  Displays detailed help for each subcommand
45
56
 
46
- * `xnlogic version`:
57
+ * `xnlogic version(1)`:
47
58
  Print the version of the xnlogic command-line tools.
48
59
 
49
60
  ## OPTIONS
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xnlogic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.26
4
+ version: 1.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darrick Wiebe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-08 00:00:00.000000000 Z
11
+ date: 2015-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -104,7 +104,6 @@ files:
104
104
  - lib/xnlogic/man/xnlogic.txt
105
105
  - lib/xnlogic/server_profile.rb
106
106
  - lib/xnlogic/templates/application/.rspec.tt
107
- - lib/xnlogic/templates/application/Gemfile.tt
108
107
  - lib/xnlogic/templates/application/Rakefile.tt
109
108
  - lib/xnlogic/templates/application/Readme.md.tt
110
109
  - lib/xnlogic/templates/application/config.ru.tt
@@ -128,6 +127,7 @@ files:
128
127
  - lib/xnlogic/templates/application/torquebox.yml.tt
129
128
  - lib/xnlogic/templates/application/torquebox_init.rb.tt
130
129
  - lib/xnlogic/templates/deploy/server_profiles/profile.rb.tt
130
+ - lib/xnlogic/templates/vagrant/Gemfile.tt
131
131
  - lib/xnlogic/templates/vagrant/Vagrantfile.tt
132
132
  - lib/xnlogic/templates/vagrant/config/datomic.conf
133
133
  - lib/xnlogic/templates/vagrant/config/transactor.properties
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements: []
160
160
  rubyforge_project:
161
- rubygems_version: 2.4.3
161
+ rubygems_version: 2.4.5
162
162
  signing_key:
163
163
  specification_version: 4
164
164
  summary: XN Logic command-line tools
@@ -1,6 +0,0 @@
1
- source "https://<%= config[:xn_key] || 'xn:key_required' %>@gems.xnlogic.com"
2
- source "https://rubygems.org/"
3
-
4
- gemspec
5
-
6
- eval File.read('Gemfile-custom') if File.exist?('Gemfile-custom')