OSDN Git Service

refactoring.
authorwhitestar <whitestar@gaea.test>
Sat, 28 Jan 2017 23:55:24 +0000 (08:55 +0900)
committerwhitestar <whitestar@gaea.test>
Sat, 28 Jan 2017 23:55:24 +0000 (08:55 +0900)
13 files changed:
cookbooks/grid/.foodcritic [new file with mode: 0644]
cookbooks/grid/.rubocop.yml [new file with mode: 0644]
cookbooks/grid/Berksfile [new file with mode: 0644]
cookbooks/grid/CHANGELOG.md
cookbooks/grid/README.md
cookbooks/grid/Rakefile [new file with mode: 0644]
cookbooks/grid/attributes/default.rb
cookbooks/grid/metadata.rb
cookbooks/grid/recipes/default.rb
cookbooks/grid/recipes/ops-utils.rb
cookbooks/grid/templates/default/etc/profile.d/gridctl.sh
cookbooks/grid/templates/default/usr/local/bin/dsh_ipass
cookbooks/grid/templates/default/usr/local/bin/gridctl

diff --git a/cookbooks/grid/.foodcritic b/cookbooks/grid/.foodcritic
new file mode 100644 (file)
index 0000000..f83b06c
--- /dev/null
@@ -0,0 +1,2 @@
+~FC001
+~FC019
diff --git a/cookbooks/grid/.rubocop.yml b/cookbooks/grid/.rubocop.yml
new file mode 100644 (file)
index 0000000..17f87f1
--- /dev/null
@@ -0,0 +1,37 @@
+AllCops:
+  Exclude:
+    - vendor/**/*
+
+AlignParameters:
+  Enabled: false
+LineLength:
+  Enabled: false
+Lint/UnusedBlockArgument:
+  Enabled: false
+Metrics/AbcSize:
+  Enabled: false
+Style/BlockComments:
+  Enabled: false
+Style/BlockDelimiters:
+  Enabled: false
+Style/ExtraSpacing:
+  Enabled: false
+Style/FileName:
+  Enabled: false
+Style/LeadingCommentSpace:
+  Enabled: false
+Style/RescueModifier:
+  Enabled: false
+Style/SpaceBeforeFirstArg:
+  Enabled: false
+Style/TrailingCommaInLiteral:
+  EnforcedStyleForMultiline: comma
+Style/WordArray:
+  Enabled: false
+  
+#Style/AccessorMethodName:
+#  Enabled: false
+#Style/MethodLength:
+#  Max: 30
+#Style/ModuleLength:
+#  Max: 150
diff --git a/cookbooks/grid/Berksfile b/cookbooks/grid/Berksfile
new file mode 100644 (file)
index 0000000..487a591
--- /dev/null
@@ -0,0 +1,23 @@
+#
+# Copyright 2017 whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+#grid_chef_repo = 'git://git.osdn.jp/gitroot/metasearch/grid-chef-repo.git'
+
+# for ver. 3.x
+#source 'https://berks-api.io.example.com:6280'
+source 'https://supermarket.chef.io'
+
+metadata
index 91d2d7b..00e5563 100644 (file)
@@ -1,5 +1,9 @@
 # CHANGELOG for grid
 
+0.1.2
+-----
+- refactoring.
+
 0.1.1
 -----
 - Documentation update.
index a395d54..05c1f31 100644 (file)
@@ -1,15 +1,23 @@
 grid Cookbook
 =============
 
-This cookbook provides some attributes for distributed computing environment and some operarional commands.
+This cookbook provides some attributes for distributed computing environment and some operational commands.
 
-Requirements
-------------
+## Contents
 
-Nothing.
+- [Requirements](#requirements)
+- [Attributes](#attributes)
+- [Usage](#usage)
+    - [Recipes](#recipes)
+        - [grid::default](#griddefault)
+        - [grid::ops-utils](#gridops-utils)
+- [License and Authors](#license-and-authors)
 
-Attributes
-----------
+## Requirements
+
+None.
+
+## Attributes
 
 |Key|Type|Description, example|Default|
 |:--|:--|:--|:--|
@@ -47,8 +55,10 @@ Attributes
 |`['grid']['gridctl']['env']['ZOOKEEPER_USER']`|String||`'zookeeper'`|
 |`['grid']['gridctl']['env']['ZOOKEEPER_PEERS']`|String|e.g. `'zk00 zk01 zk02'`|`'localhost'`|
 
-Usage
------
+## Usage
+
+### Recipes
+
 #### grid::default
 - creates fundamental derectories.
 
@@ -57,12 +67,12 @@ Usage
 -- dsh_ipass
 -- gridctl
 
-License and Authors
--------------------
+## License and Authors
+
 - Author:: whitestar at osdn.jp
 
 ```text
-Copyright 2013-2016, whitestar
+Copyright 2013-2017, whitestar
 
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
diff --git a/cookbooks/grid/Rakefile b/cookbooks/grid/Rakefile
new file mode 100644 (file)
index 0000000..513cecc
--- /dev/null
@@ -0,0 +1,23 @@
+require 'rspec/core/rake_task'
+require 'rubocop/rake_task'
+require 'foodcritic'
+
+namespace :style do
+  desc 'Run Ruby style checks'
+  RuboCop::RakeTask.new(:ruby)
+
+  desc 'Run Chef style checks'
+  FoodCritic::Rake::LintTask.new(:chef) do |t|
+    t.options = {
+      fail_tags: ['any'],
+    }
+  end
+end
+
+desc 'Run all style checks'
+task style: ['style:chef', 'style:ruby']
+
+desc 'Run ChefSpec examples'
+RSpec::Core::RakeTask.new(:spec)
+
+task default: ['style', 'spec']
index e1f66b3..6137b1f 100644 (file)
@@ -2,7 +2,7 @@
 # Cookbook Name:: grid
 # Attributes:: default
 #
-# Copyright 2013, whitestar
+# Copyright 2013-2017, whitestar
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
index f8b1f05..4dfbde3 100644 (file)
@@ -1,7 +1,10 @@
+# $ knife supermarket share grid "Applications"
 name             'grid'
 maintainer       'whitestar'
 maintainer_email ''
 license          'Apache 2.0'
-description      'Installs/Configures grid'
+description      'Grid (distributed computing environment) base cookbook'
 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
 version          '0.1.1'
+source_url       'http://scm.osdn.jp/gitroot/metasearch/grid-chef-repo.git'
+issues_url       'https://osdn.jp/projects/metasearch/ticket'
index 87830fa..98bb48d 100644 (file)
@@ -2,7 +2,7 @@
 # Cookbook Name:: grid
 # Recipe:: default
 #
-# Copyright 2013, whitestar
+# Copyright 2013-2017, whitestar
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -32,4 +32,3 @@
     recursive true
   end
 }
-
index dea26aa..7539540 100644 (file)
@@ -2,7 +2,7 @@
 # Cookbook Name:: grid
 # Recipe:: ops-utils
 #
-# Copyright 2013, whitestar
+# Copyright 2013-2017, whitestar
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 #
 
-%w{
+%w(
   dsh_ipass
   gridctl
-}.each {|command|
+).each {|command|
   template "/usr/local/bin/#{command}" do
     source "usr/local/bin/#{command}"
     owner 'root'
@@ -35,4 +35,3 @@ template '/etc/profile.d/gridctl.sh' do
   group 'root'
   mode '0644'
 end
-
index 736f2ac..d43cfd6 100755 (executable)
@@ -1,5 +1,5 @@
 #
-# Copyright 2013 the original author or authors.
+# Copyright 2013-2017 the original author or authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -18,4 +18,3 @@
 <% node['grid']['gridctl']['env'].each do |key, value| -%>
 export <%= key %>="<%= value %>"
 <% end -%>
-
index adab04e..e404cb9 100755 (executable)
@@ -4,7 +4,7 @@
 #
 # $Id: dsh_ipass 492 2013-05-10 11:16:15Z whitestar $
 #
-# Copyright 2012-2013 the original author or authors.
+# Copyright 2012-2017 the original author or authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
index d25a3b5..698f324 100755 (executable)
@@ -4,7 +4,7 @@
 #
 # $Id: gridctl 527 2013-05-16 10:49:40Z whitestar $
 #
-# Copyright 2013 the original author or authors.
+# Copyright 2013-2017 the original author or authors.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@
 # limitations under the License.
 #
 
-
 PATH=.:/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:`dirname $0`