例文を組み込んだAlfred Workflowを作りました: Alfred Git Commit Message Example
以下転載:
以下転載:
| # https://github.com/rails/rails/blob/683a0b5042262d841bfed687a4c56125364cf7a7/activesupport/lib/active_support/core_ext/object/blank.rb#L5 | |
| # https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/blank.rb | |
| class Object | |
| def blank? | |
| respond_to?(:empty?) ? !!empty? : !self | |
| end | |
| def present? | |
| !blank? | 
| # require 'open-uri' | |
| require 'thread' | |
| # require 'openssl' | |
| REST_API_CONNECT_URL = 'https://api.mokoaki.net/'.freeze | |
| def faraday_connection | |
| Faraday::Connection.new(REST_API_CONNECT_URL) do |conn| | |
| conn.headers = { | |
| 'user_agent' => "AAAAAAAAAA", | 
| require 'digest/sha1' | |
| target_path_a = ARGV[0] | |
| target_path_b = ARGV[1] | |
| def sha_data(target_path) | |
| begin | |
| file_type = File.ftype(target_path) | |
| rescue Errno::ENOENT | |
| raise "No such file or directory - #{target_path}" | 
| # records = User.where('id > 0') | |
| # records = User.where('id > 0').to_a | |
| records = [{a: 1, b: 2}, {a: 3, b: 4}] | |
| headers = | |
| if records.first.class == Hash | |
| records.first.keys | |
| elsif records.first.class.superclass == ActiveRecord::Base | |
| records.first.class.column_names.map(&:to_sym) | |
| else | 
| rails _4.2.5.2_ new testapp --skip-test-unit --database=mysql --skip-bundle | |
| rails _4.2.6_ new testapp --skip-test-unit --database=mysql --skip-bundle | |
| 変更なし | 
| rails _4.2.5.1_ new testapp --skip-test-unit --database=mysql --skip-bundle | |
| rails _4.2.5.2_ new testapp --skip-test-unit --database=mysql --skip-bundle | |
| 変更なし | 
| rails _4.2.5_ new testapp --skip-test-unit --database=mysql --skip-bundle | |
| rails _4.2.5.1_ new testapp --skip-test-unit --database=mysql --skip-bundle | |
| 変更なし | 
| rails _4.2.4_ new testapp --skip-test-unit --database=mysql | |
| rails _4.2.5_ new testapp --skip-test-unit --database=mysql | |
| 変更なし |