https://gist.github.com/4640042
- Web Service を使った iOS アプリを作りたい
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ruby には OpenStruct (require 'ostruct') もあるから微妙だけど。 | |
# | |
module Dynamic | |
def method_missing(action, *args) | |
if args.empty? | |
self[action] | |
elsif action.match(/=$/) | |
self[action.to_s.chop.to_sym] = args.first | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
# coding:utf-8 | |
require 'net/https' | |
require 'json' | |
origin_url = `git config remote.origin.url` | |
matches = origin_url.match %r,git@(github.com|bitbucket.org):(.+)/(.+).git, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InfoPlist="${SRCROOT}/${PROJECT_NAME}/${PRODUCT_NAME}-Info.plist" | |
bn=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${InfoPlist}` | |
IFS='.' | |
arr=[] | |
arr=($bn) | |
last_num=$((${#arr[*]}-1)) | |
echo $last_num | |
arr[$last_num]=$((arr[$last_num]+1)) | |
bn="${arr[*]}" | |
IFS='' |