Skip to content

Instantly share code, notes, and snippets.

View jmoody's full-sized avatar

Joshua Moody jmoody

  • Germany
View GitHub Profile
@jmoody
jmoody / dot_xamrin_dir.txt
Last active August 29, 2015 13:55
an example of a ~/.xamarin directory
[stern:~/.xamarin]: moody$ tree
.
├── devices
│   ├── android_phone -> r2d2
│   ├── android_tablet -> marvin
│   ├── earp
│   │   ├── ip
│   │   └── udid
│   ├── ipad -> venus
│   ├── iphone -> neptune
@jmoody
jmoody / Gemfile
Created February 8, 2014 17:56
Gemfile that demonstrates a way to use bundler + local, non-version controlled files to enforce local branch checks
# the idea here to rely on .calabash-gem and .briar-gem files
# that are not under version control to set the path and branch.
#
# we want bundler to force local branch checks so calabash and briar
# maintainers are allows aware of what branch they are working from.
#
# non-maintainers can simply use the Gemfile as-is.
#
# maintainers should configure bundler to check that they are working against
# the correct branch.
@jmoody
jmoody / 01_launch_sample.rb
Created March 9, 2014 17:26
cucumber Before hook for forcing iPhone app emulated on an iPad
Before do |scenario|
@calabash_launcher = Calabash::Cucumber::Launcher.new
unless @calabash_launcher.calabash_no_launch?
@calabash_launcher.relaunch
@calabash_launcher.calabash_notify(self)
if ios7?
ensure_ipad_emulation_1x
end
end
end
@jmoody
jmoody / touch_and_hold.rb
Created March 11, 2014 23:11
example of using UIAutomation + calabash to perform a touch and hold gesture
def uia_handle_target_command(cmd, *query_args)
args = query_args.map do |part|
if part.is_a?(String)
"#{escape_uia_string(part)}"
else
"#{escape_uia_string(part.to_edn)}"
end
end
command = %Q[target.#{cmd}(#{args.join(', ')})]
@jmoody
jmoody / env.sh
Created March 13, 2014 14:41
list of calabash-ios ENV vars
# a raw list created by:
# $ find . -name *.rb -type f -exec grep ENV {} \; -print > ~/tmp/calabash-vars.txt
# and then hand extracting
# * probably some duplicates
# * some of these are deprecated
# * some should be deprecated
# * some should never be set outside of gem/server development
CALABASH_IRBRC
IRBRC
xcodebuild \
-workspace wetap.xcworkspace \
-scheme wetap \
-configuration AdHoc \
-destination 'platform=iOS Simulator,name=iPhone Retina (4-inch),OS=latest' \
clean test | rbenv exec bundle exec xcpretty -c
codebuild[44797:4403] DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-5067/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/SpecificationTypes/BuiltInSpecifications/Compilers/XCGccMakefileDependencies.m:76
Details: Failed to load dependencies output contents from ``/Users/moody/Library/Developer/Xcode/DerivedData/wetap-gijejwfevueujveyphhohjhctvrf/Build/Intermediates/wetap.build/AdHoc-iphonesimulator/wetap.build/Objects-normal/i386/WtMapView.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “WtMapView.d” couldn’t be opened because there is no such file." UserInfo=0x7faebb761570 {NSFilePath=/Users/moody/Library/Developer/Xcode/DerivedData/wetap-gijejwfevueujveyphhohjhctvrf/Build/Intermediates/wetap.build/AdH
[alias]
co = checkout
st = status
br = branch
[push]
default = current
@jmoody
jmoody / paste.md
Created May 23, 2014 13:41
required information for analyzing calabash iOS issues

Please paste the output of the following commands:

# xcode installation location
$ xcode-select --print-path

# xcode version
$ xcodebuild -version

# calabash version
@wip
Scenario: Add a fountain to the Map
WARN: server version is not compatible with gem version
please update your server and gem
gem version: '0.9.169.pre6'
min server version: '0.9.169.pre6'
server version: '0.9.169.pre2'
Given the app has started
Then I should see a button to create new fountains
@jmoody
jmoody / a.rb
Last active August 29, 2015 14:01
deprecate a ruby constant
def self.const_missing(const_name)
if const_name == :FRAMEWORK_VERSION
_deprecated('0.9.169', 'no replacement', :warn)
return nil
end
raise(NameError, "uninitialized constant Calabash::Cucumber::#{const_name}")
end