dnsimple-ruby 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (8) hide show
  1. data/.gitignore +3 -0
  2. data/README +17 -1
  3. data/README.rdoc +25 -0
  4. data/README.textile +27 -0
  5. data/Rakefile +32 -0
  6. data/VERSION +1 -1
  7. data/bin/dnsimple.rb +38 -2
  8. metadata +8 -4
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg
2
+ rdoc
3
+ dnsimple-ruby.gemspec
data/README CHANGED
@@ -1,6 +1,6 @@
1
1
  A Ruby wrapper for the DNSimple API.
2
2
 
3
- == Credentials ==
3
+ == Credentials
4
4
 
5
5
  Create a file in your home directory called .dnsimple
6
6
 
@@ -8,3 +8,19 @@ In this file add the following:
8
8
 
9
9
  username: YOUR_USERNAME
10
10
  password: YOUR_PASSWORD
11
+
12
+ == Commands
13
+
14
+ The following commands are available for domains:
15
+
16
+ * dnsimple list
17
+ * dnsimple describe domain.com
18
+ * dnsimple create domain.com
19
+ * dnsimple delete domain.com
20
+ * dnsimple apply domain.com template_short_name
21
+
22
+ The following commands are available for records:
23
+
24
+ * dnsimple record:create [--prio=priority] domain.com name type content [ttl]
25
+ * dnsimple record:list domain.com
26
+ * dnsimple record:delete domain.com record_id
data/README.rdoc CHANGED
@@ -1 +1,26 @@
1
+ A Ruby wrapper for the DNSimple API.
1
2
 
3
+ == Credentials
4
+
5
+ Create a file in your home directory called .dnsimple
6
+
7
+ In this file add the following:
8
+
9
+ username: YOUR_USERNAME
10
+ password: YOUR_PASSWORD
11
+
12
+ == Commands
13
+
14
+ The following commands are available for domains:
15
+
16
+ * dnsimple list
17
+ * dnsimple describe domain.com
18
+ * dnsimple create domain.com
19
+ * dnsimple delete domain.com
20
+ * dnsimple apply domain.com template_short_name
21
+
22
+ The following commands are available for records:
23
+
24
+ * dnsimple record:create [--prio=priority] domain.com name type content [ttl]
25
+ * dnsimple record:list domain.com
26
+ * dnsimple record:delete domain.com record_id
data/README.textile ADDED
@@ -0,0 +1,27 @@
1
+ A Ruby wrapper for the DNSimple API.
2
+
3
+ h2. Credentials
4
+
5
+ Create a file in your home directory called .dnsimple
6
+
7
+ In this file add the following:
8
+
9
+ username: YOUR_USERNAME
10
+ password: YOUR_PASSWORD
11
+
12
+ h2. Commands
13
+
14
+ The following commands are available for domains:
15
+
16
+ * dnsimple list
17
+ * dnsimple describe domain.com
18
+ * dnsimple create domain.com
19
+ * dnsimple delete domain.com
20
+ * dnsimple apply domain.com template_short_name
21
+
22
+ The following commands are available for records:
23
+
24
+ * dnsimple record:create [--prio=priority] domain.com name type content [ttl]
25
+ * dnsimple record:list domain.com
26
+ * dnsimple record:delete domain.com record_id
27
+
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/rdoctask'
4
+
5
+ desc 'Default: run tests.'
6
+ task :default => [:spec]
7
+
8
+ desc 'Generate documentation.'
9
+ Rake::RDocTask.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'DNSimple Ruby'
12
+ rdoc.options << '--line-numbers' << '--inline-source'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/*.rb')
15
+ rdoc.rdoc_files.include('lib/**/*.rb')
16
+ end
17
+
18
+ begin
19
+ require 'jeweler'
20
+ Jeweler::Tasks.new do |gemspec|
21
+ gemspec.name = "dnsimple-ruby"
22
+ gemspec.summary = "A ruby wrapper for the DNSimple API"
23
+ gemspec.description = "A ruby wrapper for the DNSimple API that also includes a command-line client."
24
+ gemspec.email = "anthony.eden@dnsimple.com"
25
+ gemspec.homepage = "http://github.com/aetrion/dnsimple-ruby"
26
+ gemspec.authors = ["Anthony Eden"]
27
+ gemspec.add_dependency "httparty"
28
+ end
29
+ rescue LoadError
30
+ puts "Jeweler not available. Install it with: gem install jeweler"
31
+ end
32
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.3.0
data/bin/dnsimple.rb CHANGED
@@ -8,6 +8,42 @@ cli = DNSimple::CLI.new
8
8
 
9
9
  require 'optparse'
10
10
 
11
+ def usage
12
+ $stderr.puts <<EOF
13
+
14
+ This is a command line tool for DNSimple. More information about DNSimple can
15
+ be found at http://dnsimple.com/
16
+
17
+ Before using this tool you should create a file called .dnsimple in your home
18
+ directory and add the following to that file:
19
+
20
+ username: YOUR_USERNAME
21
+ password: YOUR_PASSWORD
22
+
23
+ == Commands
24
+
25
+ All commands are executed as dnsimple [options] command [command-options] args
26
+
27
+
28
+ The following commands are available:
29
+
30
+ help # show this usage
31
+
32
+ list # List all domains
33
+
34
+ describe domain.com # Describe the given domain
35
+ create domain.com # Add the given domain
36
+ delete domain.com # Delete the given domain
37
+ apply domain.com template_short_name # Apply a template to the domain
38
+
39
+ record:create [--prio=priority] \\
40
+ domain.com name type content [ttl] # Create the DNS record on the domain
41
+ record:list domain.com # List all records for the domain
42
+ record:delete domain.com record_id # Delete the given domain
43
+
44
+ EOF
45
+ end
46
+
11
47
  options = {}
12
48
 
13
49
  global = OptionParser.new do |opts|
@@ -37,8 +73,8 @@ subcommands = {
37
73
 
38
74
  global.order!
39
75
  command = ARGV.shift
40
- if command.nil?
41
- puts "You must specify a command"
76
+ if command.nil? || command == 'help'
77
+ usage
42
78
  else
43
79
  options_parser = subcommands[command]
44
80
  options_parser.order! if options_parser
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 2
8
- - 1
9
- version: 0.2.1
7
+ - 3
8
+ - 0
9
+ version: 0.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Anthony Eden
@@ -39,8 +39,13 @@ extensions: []
39
39
  extra_rdoc_files:
40
40
  - README
41
41
  - README.rdoc
42
+ - README.textile
42
43
  files:
44
+ - .gitignore
43
45
  - README
46
+ - README.rdoc
47
+ - README.textile
48
+ - Rakefile
44
49
  - VERSION
45
50
  - bin/dnsimple
46
51
  - bin/dnsimple.rb
@@ -65,7 +70,6 @@ files:
65
70
  - spec/record_spec.rb
66
71
  - spec/spec_helper.rb
67
72
  - spec/template_spec.rb
68
- - README.rdoc
69
73
  has_rdoc: true
70
74
  homepage: http://github.com/aetrion/dnsimple-ruby
71
75
  licenses: []