qb 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +146 -0
  3. data/.qb-options.yml +4 -0
  4. data/.rspec +2 -0
  5. data/.travis.yml +4 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +4 -0
  9. data/Rakefile +6 -0
  10. data/ansible.cfg +5 -0
  11. data/bin/console +14 -0
  12. data/bin/qb +287 -0
  13. data/bin/setup +9 -0
  14. data/dev/bin/.gitkeep +0 -0
  15. data/dev/bin/ungem +19 -0
  16. data/dev/setup.yml +58 -0
  17. data/lib/qb.rb +5 -0
  18. data/lib/qb/version.rb +3 -0
  19. data/library/git_mkdir.py +70 -0
  20. data/library/qb_facts.py +38 -0
  21. data/qb.gemspec +27 -0
  22. data/requirements.yml +2 -0
  23. data/roles/qb.gem/.qb-options.yml +4 -0
  24. data/roles/qb.gem/defaults/main.yml +17 -0
  25. data/roles/qb.gem/files/.gitkeep +0 -0
  26. data/roles/qb.gem/files/.rspec +2 -0
  27. data/roles/qb.gem/files/Rakefile +6 -0
  28. data/roles/qb.gem/files/setup +7 -0
  29. data/roles/qb.gem/filter_plugins/ruby_constantize.py +22 -0
  30. data/roles/qb.gem/meta/main.yml +35 -0
  31. data/roles/qb.gem/tasks/main.yml +105 -0
  32. data/roles/qb.gem/templates/.gitkeep +0 -0
  33. data/roles/qb.gem/templates/.travis.yml.j2 +4 -0
  34. data/roles/qb.gem/templates/BSD2-LICENSE.txt.j2 +23 -0
  35. data/roles/qb.gem/templates/BSD3-LICENSE.txt.j2 +27 -0
  36. data/roles/qb.gem/templates/Gemfile.j2 +4 -0
  37. data/roles/qb.gem/templates/MIT-LICENSE.txt.j2 +21 -0
  38. data/roles/qb.gem/templates/console.j2 +14 -0
  39. data/roles/qb.gem/templates/gemspec.j2 +36 -0
  40. data/roles/qb.gem/templates/module.rb.j2 +5 -0
  41. data/roles/qb.gem/templates/spec.rb.j2 +11 -0
  42. data/roles/qb.gem/templates/spec_helper.rb.j2 +2 -0
  43. data/roles/qb.gem/templates/version.rb.j2 +3 -0
  44. data/roles/qb.git_repo/defaults/main.yml +2 -0
  45. data/roles/qb.git_repo/meta/main.yml +5 -0
  46. data/roles/qb.git_repo/tasks/main.yml +9 -0
  47. data/roles/qb.gitignore/defaults/main.yml +4 -0
  48. data/roles/qb.gitignore/meta/main.yml +12 -0
  49. data/roles/qb.gitignore/tasks/main.yml +31 -0
  50. data/roles/qb.project/.qb-options.yml +3 -0
  51. data/roles/qb.project/defaults/main.yml +12 -0
  52. data/roles/qb.project/meta/main.yml +49 -0
  53. data/roles/qb.project/qb/get_dir +13 -0
  54. data/roles/qb.project/tasks/main.yml +102 -0
  55. data/roles/qb.project/templates/.gitkeep +0 -0
  56. data/roles/qb.project/templates/README.md.j2 +2 -0
  57. data/roles/qb.project/templates/setup.yml.j2 +52 -0
  58. data/roles/qb.role/.qb-options.yml +3 -0
  59. data/roles/qb.role/defaults/main.yml +9 -0
  60. data/roles/qb.role/meta/main.yml +31 -0
  61. data/roles/qb.role/tasks/main.yml +117 -0
  62. data/roles/qb.role/templates/.gitkeep +0 -0
  63. data/roles/qb.role/templates/defaults/main.yml.j2 +2 -0
  64. data/roles/qb.role/templates/handlers/main.yml.j2 +2 -0
  65. data/roles/qb.role/templates/meta/main.yml.j2 +5 -0
  66. data/roles/qb.role/templates/tasks/main.yml.j2 +2 -0
  67. data/roles/qb.role/templates/vars/main.yml.j2 +2 -0
  68. data/scratch/case.rb +38 -0
  69. data/temp.yml +19 -0
  70. metadata +169 -0
@@ -0,0 +1,3 @@
1
+ ---
2
+ qb.role:
3
+ templates: true
@@ -0,0 +1,9 @@
1
+ ---
2
+ role_name: "{{ dir | basename }}"
3
+ role_defaults: true
4
+ role_files: false
5
+ role_handlers: false
6
+ role_meta: true
7
+ role_tasks: true
8
+ role_templates: false
9
+ role_vars: false
@@ -0,0 +1,31 @@
1
+ ---
2
+ # meta file for qb.role
3
+
4
+ dependencies: []
5
+ # - role: role-name
6
+
7
+ qb_info:
8
+ vars:
9
+ - name: name
10
+ type: string
11
+ short: n
12
+
13
+ - name: files
14
+ type: boolean
15
+
16
+ - name: handler
17
+ type: boolean
18
+
19
+ - name: meta
20
+ type: boolean
21
+ description: create meta/main.yml
22
+
23
+ - name: tasks
24
+ type: boolean
25
+
26
+ - name: templates
27
+ type: boolean
28
+ description: create a templates directory.
29
+
30
+ - name: vars
31
+ type: boolean
@@ -0,0 +1,117 @@
1
+ ---
2
+
3
+ # defaults
4
+ # ========
5
+
6
+ - name: create defaults directory
7
+ file:
8
+ path: "{{ dir }}/defaults"
9
+ state: directory
10
+ when: role_defaults
11
+
12
+ - name: create defaults/main.yml
13
+ template:
14
+ src: defaults/main.yml.j2
15
+ dest: "{{ dir }}/defaults/main.yml"
16
+ force: false
17
+ when: role_defaults
18
+
19
+ # files
20
+ # =====
21
+
22
+ - name: create files directory
23
+ file:
24
+ path: "{{ dir }}/files"
25
+ state: directory
26
+ when: role_files
27
+
28
+ # TODO: you might want to remove .gitkeep after the dir has actual contents
29
+ # but this would keep creating it.
30
+ - name: create a .gitkeep in the files directory
31
+ copy:
32
+ content: ""
33
+ dest: "{{ dir }}/files/.gitkeep"
34
+ force: false
35
+ when: role_files
36
+
37
+ # handlers
38
+ # ========
39
+
40
+ - name: create handlers directory
41
+ file:
42
+ path: "{{ dir }}/handlers"
43
+ state: directory
44
+ when: role_handlers
45
+
46
+ - name: create handlers/main.yml
47
+ template:
48
+ src: handlers/main.yml.j2
49
+ dest: "{{ dir }}/handlers/main.yml"
50
+ force: false
51
+ when: role_handlers
52
+
53
+ # meta
54
+ # ====
55
+
56
+ - name: create meta directory
57
+ file:
58
+ path: "{{ dir }}/meta"
59
+ state: directory
60
+ when: role_meta
61
+
62
+ - name: create meta/main.yml
63
+ template:
64
+ src: meta/main.yml.j2
65
+ dest: "{{ dir }}/meta/main.yml"
66
+ force: false
67
+ when: role_meta
68
+
69
+ # tasks
70
+ # =====
71
+
72
+ - name: create tasks directory
73
+ file:
74
+ path: "{{ dir }}/tasks"
75
+ state: directory
76
+ when: role_tasks
77
+
78
+ - name: create tasks/main.yml
79
+ template:
80
+ src: tasks/main.yml.j2
81
+ dest: "{{ dir }}/tasks/main.yml"
82
+ force: false
83
+ when: role_tasks
84
+
85
+ # templates
86
+ # =========
87
+
88
+ - name: create templates directory
89
+ file:
90
+ path: "{{ dir }}/templates"
91
+ state: directory
92
+ when: role_templates
93
+
94
+ # TODO: you might want to remove .gitkeep after the dir has actual contents
95
+ # but this would keep creating it.
96
+ - name: create a .gitkeep in the templates directory
97
+ copy:
98
+ content: ""
99
+ dest: "{{ dir }}/templates/.gitkeep"
100
+ force: false
101
+ when: role_templates
102
+
103
+ # vars
104
+ # ====
105
+
106
+ - name: create vars directory
107
+ file:
108
+ path: "{{ dir }}/vars"
109
+ state: directory
110
+ when: role_vars
111
+
112
+ - name: create vars/main.yml
113
+ template:
114
+ src: vars/main.yml.j2
115
+ dest: "{{ dir }}/vars/main.yml"
116
+ force: false
117
+ when: role_vars
File without changes
@@ -0,0 +1,2 @@
1
+ ---
2
+ # defaults file for {{ role_name }}
@@ -0,0 +1,2 @@
1
+ ---
2
+ # handlers file for {{ role_name }}
@@ -0,0 +1,5 @@
1
+ ---
2
+ # meta file for {{ role_name }}
3
+
4
+ dependencies: []
5
+ # - role: role-name
@@ -0,0 +1,2 @@
1
+ ---
2
+ # tasks file for {{ role_name }}
@@ -0,0 +1,2 @@
1
+ ---
2
+ # vars file for {{ role_name }}
@@ -0,0 +1,38 @@
1
+ class Object
2
+ def on_length procs
3
+ length_map = procs.map {|proc|
4
+ [proc.arity, proc]
5
+ }.to_h
6
+
7
+ length_map[length].(*self)
8
+ end
9
+ end
10
+
11
+ def f args
12
+ puts "args: #{ args.inspect }"
13
+ args.on_length([
14
+ -> {
15
+ puts "none"
16
+ },
17
+ ->(x) {
18
+ puts "single: #{ x }"
19
+ },
20
+ ->(x, y) {
21
+ puts "double: #{ x }, #{ y }"
22
+ },
23
+ ])
24
+ puts
25
+ end
26
+
27
+ f = (args) ->
28
+ (x) ->
29
+ (x:Hash) ->
30
+ ['', x]
31
+ (x) ->
32
+ [x, {}]
33
+
34
+ (x, y) -> [x, y]
35
+
36
+ f []
37
+ f [:x]
38
+ f [:x, :y]
@@ -0,0 +1,19 @@
1
+ ---
2
+ - hosts: localhost
3
+ roles:
4
+ # cmd: qb role path=roles/qb.role templates meta
5
+ # qb role roles/qb.role --templates --meta --path=roles/qb.role
6
+ #
7
+ # how to turn something OFF that defaults to on
8
+ # qb role --defaults=off
9
+ # qb role -d off
10
+ # - role: qb.role
11
+ # role_path: ./roles/qb.role
12
+ # role_templates: true
13
+ # role_meta: true
14
+ # - role: qb.test
15
+
16
+ tasks:
17
+ - qb_facts:
18
+
19
+ - debug: msg="{{ git_user_name }}"
metadata ADDED
@@ -0,0 +1,169 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: qb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - nrser
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-02-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: cmds
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 0.0.9
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: 0.0.9
69
+ description:
70
+ email:
71
+ - neil@ztkae.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".qb-options.yml"
78
+ - ".rspec"
79
+ - ".travis.yml"
80
+ - Gemfile
81
+ - LICENSE.txt
82
+ - README.md
83
+ - Rakefile
84
+ - ansible.cfg
85
+ - bin/console
86
+ - bin/qb
87
+ - bin/setup
88
+ - dev/bin/.gitkeep
89
+ - dev/bin/ungem
90
+ - dev/setup.yml
91
+ - lib/qb.rb
92
+ - lib/qb/version.rb
93
+ - library/git_mkdir.py
94
+ - library/qb_facts.py
95
+ - qb.gemspec
96
+ - requirements.yml
97
+ - roles/qb.gem/.qb-options.yml
98
+ - roles/qb.gem/defaults/main.yml
99
+ - roles/qb.gem/files/.gitkeep
100
+ - roles/qb.gem/files/.rspec
101
+ - roles/qb.gem/files/Rakefile
102
+ - roles/qb.gem/files/setup
103
+ - roles/qb.gem/filter_plugins/ruby_constantize.py
104
+ - roles/qb.gem/meta/main.yml
105
+ - roles/qb.gem/tasks/main.yml
106
+ - roles/qb.gem/templates/.gitkeep
107
+ - roles/qb.gem/templates/.travis.yml.j2
108
+ - roles/qb.gem/templates/BSD2-LICENSE.txt.j2
109
+ - roles/qb.gem/templates/BSD3-LICENSE.txt.j2
110
+ - roles/qb.gem/templates/Gemfile.j2
111
+ - roles/qb.gem/templates/MIT-LICENSE.txt.j2
112
+ - roles/qb.gem/templates/console.j2
113
+ - roles/qb.gem/templates/gemspec.j2
114
+ - roles/qb.gem/templates/module.rb.j2
115
+ - roles/qb.gem/templates/spec.rb.j2
116
+ - roles/qb.gem/templates/spec_helper.rb.j2
117
+ - roles/qb.gem/templates/version.rb.j2
118
+ - roles/qb.git_repo/defaults/main.yml
119
+ - roles/qb.git_repo/meta/main.yml
120
+ - roles/qb.git_repo/tasks/main.yml
121
+ - roles/qb.gitignore/defaults/main.yml
122
+ - roles/qb.gitignore/meta/main.yml
123
+ - roles/qb.gitignore/tasks/main.yml
124
+ - roles/qb.project/.qb-options.yml
125
+ - roles/qb.project/defaults/main.yml
126
+ - roles/qb.project/meta/main.yml
127
+ - roles/qb.project/qb/get_dir
128
+ - roles/qb.project/tasks/main.yml
129
+ - roles/qb.project/templates/.gitkeep
130
+ - roles/qb.project/templates/README.md.j2
131
+ - roles/qb.project/templates/setup.yml.j2
132
+ - roles/qb.role/.qb-options.yml
133
+ - roles/qb.role/defaults/main.yml
134
+ - roles/qb.role/meta/main.yml
135
+ - roles/qb.role/tasks/main.yml
136
+ - roles/qb.role/templates/.gitkeep
137
+ - roles/qb.role/templates/defaults/main.yml.j2
138
+ - roles/qb.role/templates/handlers/main.yml.j2
139
+ - roles/qb.role/templates/meta/main.yml.j2
140
+ - roles/qb.role/templates/tasks/main.yml.j2
141
+ - roles/qb.role/templates/vars/main.yml.j2
142
+ - scratch/case.rb
143
+ - temp.yml
144
+ - tmp/.gitkeep
145
+ homepage: https://github.com/nrser/qb
146
+ licenses:
147
+ - MIT
148
+ metadata: {}
149
+ post_install_message:
150
+ rdoc_options: []
151
+ require_paths:
152
+ - lib
153
+ required_ruby_version: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ required_rubygems_version: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ requirements: []
164
+ rubyforge_project:
165
+ rubygems_version: 2.2.2
166
+ signing_key:
167
+ specification_version: 4
168
+ summary: qb is all about projects. named after everyone's favorite projects.
169
+ test_files: []