Upon updating your older project to Rails 3.2, one of the first things you will see is a deprecation notice in your logs:
You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this:http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released
Your first thought might be to just rewrite this yourself and get rid of this circa-2006 code anyway, but the lazy sloth in you says "if it ain't broke, don't fix it" so you google for the easy solution... landing here. This post will show you how to quickly convert your simple old-school plugins into simple libs per the Rails 3.2 Release Notes. This might not work for crazy-advanced-super-plugin-eleventeen-point-oh, but for the simple ones it should suffice.
You will have to make sure you didn't fuck anything up, but for my simple plugins, this process was enough.
As seen in Ambiance, UAModalPanel is an alternative modal panel that you can popup in your view controllers to show content that might not need an entire new screen to show. It works on the iPhone and iPad, with or without rotation, and is a non-ARC project.
UAModalPanel is hosted on Github
I recently finished a Mac App called Thumbs and I wanted to upload and submit the binary to the Mac App Store through Xcode. Sounds easy enough right? I ran into this error:
Ok. So after (wrongfully) tinkering with the Base SDK and deployment target, ensuring I was on Xcode 4.2.1 (non-beta), I re-read the error and refocused on the OS. I am running Lion 10.7.2, but it turns out I was on the Beta track! Simple fix right? Nope.Trying to get back to 10.7.2 official didn't work for me at all. I tried downloading it from the Apple developer site but they redirected me to the Mac App Store. Mac App Store sees that I am already running 10.7.2 and wouldn't let me download. I found an Update on Apple support pages that claimed I could update to 10.7.2, but nope. I thought about partitioning my hard drive and installing fresh, but that would mean that I had to deal with exporting importing my keys, development environment and profiles. Ugh. I decided to hit the twitterverse and a few minutes later, I got a reply from @christian_beer:
Ooooh, a hack. Me likes. I couldn't find the referenced post, but I was able to find the plist anyway at/System/Library/CoreServices/SystemVersion.plist
The fix was simple: Change the ProductBuildVersion to be 11C74 (or the most current non-beta build of OS X), restart Xcode, and rebuild your project. To verify your change, open About This Mac:
Don't forget to change it back right after you upload. I would not advise restarting your computer or doing anything else. I don't know what else this could affect.
You can Archive and Submit from Xcode now and you won't be held up by the error:
This bundle is invalid. Apple is not currently accepting applications built with this version of the OS.
I was testing the dynamically loaded dependencies of a static ffmpeg binary today, and I saw that libSystem.B.dylib was indeed a dependency.
coneybeare $ otool -L ffmpeg:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.0.0)
coneybeare $ sudo mv /usr/lib/libSystem.B.dylib /usr/lib/_libSystem.B.dylib
The library moved and I tried running a command using the ffmpeg binary, when BAM, I got a missing library error. I did some research and found that the libSystem.B.dylib library should exist on any functional OS X install, so I decided to not worry about the error and attempted to move the library back
coneybeare $ sudo mv /usr/lib/_libSystem.B.dylib /usr/lib/libSystem.B.dylib
… Missing Library Error. Then it hit me, sudo, mv and all other bash goodies were dependent on this library and in order to move the library back to its original position, it needed to be loaded. It could not be loaded though because the library was in an unexpected location. Shit. I tried sshing in to see if I could do something that way, didn't work. ssh must also depend on the library. I tried a restart in safe mode, but the safe-mode boot must also depend on the library as it spun on the gray load screen for ever. I tried setting up the computer in target mode, but that did not work as well. I tried to open the cd tray to load in my OS X disc and get the terminal but my bluetooth keyboard was not working, probably because of the missing library. I really thought I was fucked here. At long last I remembered the low level boot disk switcher! I tracked down a USB keyboard and mouse, plugged them in and restarted the computer holding down the Option key. After a short while, I was presented with the Boot Disk selection screen! I tapped the eject button and threw in my Restore disk. After choosing the default language, I went to the title bar and opened up terminal. then I was able to run my command:
coneybeare $ mv /Volumes/Macintosh\ HD/usr/lib/_libSystem.B.dylib /Volumes/Macintosh\ HD/usr/lib/libSystem.B.dylib
After a reboot, all was working once again :) Hope this helps anybody else who made the same bonehead mistake that I did.
It happens more than you think. I mean really, have you ever really read the 43 page long terms of agreement that these sites make you agree to before signing up? Many of them probably say something along the lines of "we may give your email to special partners blah blah blah". While you can't always prevent this from happening, you can figure out how that spammy viagra email landed in your Gmail account.
This trick has been around for awhile now, but I have only recently started using it and it works flawlessly. When you sign up for new services on sites that require an email, you won't use your real Gmail address but a slightly modified one. You take whatever your Gmail name is (before the @ sign) add a "+", then add the site name after that, but before the "@". It is not as hard as it sounds.
Lets say Dexter comes along and wants to setup an account at Phlebotomy Emporium to get a quick discount on needles. He would take his original email, add a "+", then add "phlebotomy_emporium" to it like so:
The trick here is that Gmail will ignore anything after the "+", and send it to your real account. If they ever sell your email to somebody else, you will still see which company it originated from when it is sent to you. In some cases, they might have broken the law when selling your email so check up on it and act accordingly.
Test it out by simply sending an email to yourself with +foobar or something else. This may work with other mail carriers but I haven't tested them out. Perhaps you can comment here if you see it working on somewhere other than Gmail. Happy spam fighting!
I have been using this theme in Xcode and have become quite accustomed to the subtle, light on dark colors of it. It only has 5 colors (KISS) and is easy on the eyes during those late night coding sessions. I really only use Coda for Rails development so, there are only seestyles for Ruby, ERB, HTML and CSS.
UPDATE
Many people have asked me to writeup some custom HTML code for thier signatures. So many have asked me since writing this article that I have decided to start a custom HTML email signature website to help you all out. For a small fee, I will take your information and appearance requests, generate a few different options to choose from, formulate HTML code that is safe for emails, host any custom images for you, and help guide you through the installation process. Follow through to GiantUser for more info.
ORIGINAL POST
There are plenty of tutorials online to create an HTML signature in Apple Mail with Snow Leopard, but it has changed slightly for Lion. Here is how to do it:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<br /> <br /> <div id="sig" style="min-width: 960px; min-height: 82px; line-height: 18px; margin: 6px 0; padding: 8px; border-top: 1px #999999 dotted; border-bottom: 1px #999999 dotted; font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; font-size: 12px; color: #999999; " > <a href="http://urbanapps.com" title="urbanapps.com"><img src="http://.../images/logo_noshad_80.png" alt="Urban Apps" style="float: left; padding: 2px 6px 0 0; border: none;"></a> <div style="padding: 6px 0 0 0"> <span style="font-size:14px"><strong style="color: #333333">Matt Coneybeare</strong>, Founder</span><br /> <strong><a href="http://urbanapps.com" title="urbanapps.com" style="color: #666666; text-decoration: none; border-bottom: 1px #cccccc dotted;">Urban Apps, LLC</a></strong><br /> PO Box 765, Centereach, New York, 11720, U.S.A. | Telephone: 347.688.7226 | Fax: 631.615.6716<br /> <a href="http://twitter.com/urbanapps"><img src="http://.../images/social/twitter_16.png" alt="Twitter" style="float: left; margin: 2px 4px 0 0; border: none;"></a> <a href="http://facebook.com/urbanapps"><img src="http://.../images/social/facebook_16.png" alt="Facebook" style="float: left; margin: 2px 4px 0 0; border: none;"></a> <a href="http://www.linkedin.com/in/coneybeare"><img src="http://.../images/social/linkedin_16.png" alt="Linked In" style="float: left; margin: 2px 4px 0 0; border: none;"></a> </div> <div style="clear:both"></div> </div> <br /> <br /> |
I Do Mass Quantities Of… Coke Code.
Yes, those are 1's and 0's on the scale :) A great gift from Aunt Robyn and Uncle Dan
Something is compelling me to go in here… Found on Massachusetts Ave. in Cambridge, MA.
mkdir -p ~/Library/Developer/Xcode/UserData/FontAndColorThemes; cd ~/Library/Developer/Xcode/UserData/FontAndColorThemes; curl -O http://files.urbanapps.com/ǝɹɐǝqʎǝuoɔ.dvtcolortheme
Enjoy :)
Ambiance for the Desktop was released this week and we got some pretty great reviews about it:
These posts drove tons of traffic to the main Ambiance website where we had thousands of downloads:
This was great news for us and we were expecting to stand out in the Adobe Air Marketplace, but when we checked our download count on the Ambiance product page, there were only a few hundred.
We quickly figured out that Adobe is only counting downloads that are directly from their site in this total, and most of the Ambiance downloads came direct from our website. Even though the files downloaded are exactly the same, the download stats weren't updating from our site. Here is how we fixed it.We ran the excellent HTTPScoop to trace all outgoing calls made on our test machine. We then visited the Ambiance product page and clicked download, collecting the 4 http calls that were sent to Adobe during the process.
The last GET was the actual file, the stats GET was for Adobe Analytics of some sort, so we tried the other 2. We ran a simple curl test on the POST call to see if it affected the download count:
1
|
while true; do curl -d "OFFERINGID=20777&PUBLISHERID=21008&MARKETPLACEID=1&method=trackClickThrough&_=" http://www.adobe.com/cfusion/marketplace/remote/uiWidgetsService.cfc; sleep 10; done |
We ran this for a few minutes, then checked the Ambiance product page once more and voila! The count went up by the same number of POSTs we sent. Knowing this, we added an onclick to the div that contains our download button on our website:
1 2 3 4 |
<div id="flashcontent" onclick="$.post('http://www.adobe.com/cfusion/marketplace/remote/uiWidgetsService.cfc', { OFFERINGID: '20777', PUBLISHERID: '21008', MARKETPLACEID:'1', method:'trackClickThrough', _:'' } );"> ... </div> |
Now, whenever anybody downloads from the Ambiance website directly, or downloads from the Ambiance product page, the download count will accurately increment by 1.
At Urban Apps, we want to help spread the cheer this holiday season and what better way than by offering our Award Winning app, Ambiance for only $0.99. Get it while you can because this is only a temporary sale and will go back to the regular price of $2.99 in a few days.
- Urban Apps Staff
Available Now
This update finally brings full iPad support for iPad OS 3.2 and 4.2 as a Universal app. If you have already bought Ambiance for your iPhone, now you can get it on your iPad at no additional cost!
ADDED
UPDATE: 2:39 AM
We had to remove the app from the store temporarily but it should be back soon
UPDATE: Nov 12th, 8:17 PM
The app is now back live in the store as version 3.1.1
I have been using this Xcode theme for awhile now and I think its rather nice. If you like it, just copy the line below into terminal and run it to install. Restart Xcode and check preferences for "ǝɹɐǝqʎǝuoɔ".
mkdir -p ~/Library/Application\ Support/Xcode/Color\ Themes; cd ~/Library/Application\ Support/Xcode/Color\ Themes; curl http://files.urbanapps.com/ǝɹɐǝqʎǝuoɔ.xccolortheme > ǝɹɐǝqʎǝuoɔ.xccolortheme
Enjoy :)
I have an app that fully support rotation. I am modally adding a UIImagePickerController for which there is no support for UIInterfaceOrientationLandscape and I cannot get the controller to stay in portrait.
In other words, I need to disable rotation for the UIImagePickerController so it stays in portrait, without removing rotation for the rest of my app. this seems basic, but I can't seem to locate it. How can I prevent this rotation?
UPDATE
As suggested, I tried subclassing with the following code:
@interface UAImagePickerController : UIImagePickerController {
}
@end
@implementation UAImagePickerController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return UIDeviceOrientationIsPortrait(toInterfaceOrientation);
}
@end
The line is not being hit at all with a breakpoint… i think there must be something funky about the UIImagePickerView
I just asked a question about an "Illegal Character" in my javascript.
The answer there led me to find that there is a problem with compressing javascript in the Rails asset pipeline inserting various Illegal Characters.
The error I was receiving in the post was:
SyntaxError: Invalid character '\u0008'
I found that not using compression caused this to go away completely... but I want compression! That error was found using the Rails default uglifer gem. I thought maybe it was a bug with that particular compression gem so I tried using other compressors as directed on the Rails docs. I got very similar, but different errors:
Uglifier: SyntaxError: Invalid character '\u0008'
Closure: SyntaxError: Invalid character '\u0190'
YUI: SyntaxError: Invalid character '\u0025'
I tried looking at the minimized code for these, but because the "Invalid character" is different each time, it is leading me to believe something else is the problem.
Here is an example compressed JS file. Can anybody point me in the right direction here?
I am setting up a server and am getting a strange error I have never seen before:
It is complaining about line 1 in the source, but that is just the DOCTYPE tag!
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -->
...
As you can see I already tried setting the Content-Type to be something other than utf-8. What is happening here?
412 Likes: http://ambianceapp.com
169 Likes: https://www.facebook.com/ambianceapp
<meta property="fb:admins" content="1230951" />
<meta property="fb:page_id" content="168164236564309" />
<meta property="fb:app_id" content="156067184497"/>
On first glance, I thought that it was combining the page_id and app_id, but ever since I moved away from the Facebook SDK in my app (one a year ago), the Like count for the app page has dwindled to only a handful. Not enough to count towards the 412.
How can I ensure that all 412 people who have liked my site are notified when I post to my Facebook page, and why isn't Facebook showing an accurate count?
I am trying to make a NSScrollView with clipped corners, similar to the Twitter app:
I have a NSScrollView subclass which I added the following code:
- (void)drawRect:(NSRect)dirtyRect {
NSBezierPath *pcath = [NSBezierPath bezierPathWithRoundedRect:[self bounds] xRadius:kDefaultCornerRadius yRadius:kDefaultCornerRadius];
[path setClip];
[super drawRect:dirtyRect];
}
I expected the content of the NSScrollView to have rounded corners, but it is not respecting the clipped path. How can I do this?
UPDATE & CLARIFICATION
I know how to make a custom NSScroller, I know how to make it transparent overlay. All I am asking is how to make the NSSCrollView clip its corners, including everything it contains. The NSScrollView is inside a NSView which has a background that could change, meaning a view overlay to fake the rounded corners is not an option.
I am trying to add a custom control as the titleView in a UINavigationBar. When I do so, despite setting the frame and the properties that would normally assume full width, I get this:
The bright blue can be ignored as it is where I am hiding my custom control. The issue is the narrow strips of navbar at the ends of the bar. How can I get rid of these so my customview will stretch 100%?
CGRect frame = CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y, self.view.width, kDefaultBarHeight);
UANavBarControlView *control = [[[UANavBarControlView alloc] initWithFrame:frame] autorelease];
control.autoresizingMask = UIViewAutoresizingFlexibleWidth;
self.navigationItem.titleView = control;
PS - I know I can add the view by itself instead of being attached to a navigation bar and it would be very easy to position it myself. I have my reasons for needing it to be "on" the navigation bar, and those reasons are here
This can be done by checking the http headers or etags.
28k is probably just the directory structure and Apple bookkeeping. To be sure, hook up your device to the Xcode organizer and download the documents directory to your hard drive to take a peek.
Apple does not keep track of your data for you. It only shows what you tell it to. Thus, you have to store the count on your server, then tell apple the new badge number when you send the alert. Typically this is done by having the app phone home when launched telling your servers to zero out the count of unread notifications.
This depends on the server. By convention, the right way is to use all caps, for all types of connections from all devices. Some servers treat anything that is not understood to be a GET and that might be why it was working for you in that specific scenario.
If you are using CoreData and iCloud, Apple recommends that you save all the records through the standard methods and not import a pre-filled DB. You can just run through a script on first launch in the background, then popup a quick "Importing data... This will only happen once" message.
I know how to setup nested resources in the routes files already… the question is for how to do it optionally with the same payload, and with fewer lines.
Lets say I have a BlogSite. BlogSite has many Posts, but it also has many Authors and many Dates. (this might not be the best example, but bear with me).
To do CRUD on a Post, I want to be able to use
/blog_sites/1/author/2/date/3/posts #all posts on site 1 from author 2 on date 3
/blog_sites/1/author/2/posts #all posts on site 1 from author 2
/blog_sites/1/date/3/posts #all posts on site 1 on date 3
/blog_sites/1/posts #all posts on site 1
/author/2/date/3/posts #all posts from author 2 on date 3
/author/2/posts #all posts from author 2
/date/3/posts #all posts from date 3
/posts #all posts
Such that any of the filtering parameters can be optional in the URL. I know that you can use something like
get (/blog_sites/:blog_id)(/author/:author_id)(/date/:date_id)/posts => "posts#index"
but I don't want to lose all the CRUD benefits of using nested resource routing. Currently I have to duplicate much of the routing to make it work, and am looking for a better way to do this:
resources :blog_sites do
resources :authors do
resources :dates do
resources :posts
end
resources :posts
end
resources :dates do
resources :posts
end
resources :posts
end
… and so on. It can get pretty unmanageable petty quickly.
How can I maintain the optional param urls whilst keeping routes.rb DRY and sane?
I know how to setup and display an oval shape. I know how to apply a gradient to this shape. What I cant figure out is how I can get an oval gradient to match the shape.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<gradient
android:startColor="#66FFFFFF"
android:endColor="#00FFFFFF"
android:gradientRadius="100"
android:type="radial" />
</shape>
If you can imagine, this gradient has a semi transparent white glow in the middle, then fades to alpha zero at the edges. I need to get it to go out in an oval shape, not just a circular gradient. How can I achieve this?
So I thought that negative numbers, when mod'ed should be put into positive space... I cant get this to happen in objective-c
I expect this:
-1 % 3 = 2
0 % 3 = 0
1 % 3 = 1
2 % 3 = 2
But get this
-1 % 3 = -1
0 % 3 = 0
1 % 3 = 1
2 % 3 = 2
Why is this and is there a workaround?
No, that is a level of abstraction that the developer is not supposed to worry about.
There are a ton of reasons why this could happen. Check out the official Apple Q&A Guide on the subject:
Why won't my UIViewController rotate with the device?
The view controller does not implement this delegate method: (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
The view controller's UIView property is embedded inside UIWindow but alongside an additional view controller.
You have added your view controller's UIView property to UIWindow as a subview, but prematurely released it soon after.
All child view controllers in your UITabBarController or UINavigationController do not agree on a common orientation set.
Overriding the -(id)init: or -(id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle method without calling super.
I would suggest using the Facebook iOS SDK. there are examples and more info there for hooking up your app to Facebook.
I have done some extensive searching for code examples on this but cannot find anything.
In particular, I am looking to add a shadow to a png drawable I am using in an ImageView. This png drawable is a rounded rect with transparent corners.
Can somebody please provide a code example of how to add a decent drop shadow to a view either in code or XML?
To clarify on dasblinkenlights answer, this is declaring a variable:
NSError *error;
... and this is declaring AND assigning a variable
NSError *error = nil;
When you use it the first way and try to access it without ever setting it to something, the value it is pointing at is known as "garbage" It is a pointer to some other stack of memory, and accessing it will almost always make your app crash. Thus, it is always best practice to assign a value to your variable as above, or shortly after.
Make sure that the file is indeed an mp3 format. Make sure that you are copying the file into the bundle, and not playing off of local path on your desktop. Check the device volume. Check the return BOOL from the play call. all of these are possible explanations.
You can just unarchive the same way using an NSKeyedUnarchiver to get your original data back. Then, assuming it is a NSDictionary and you make a mutable copy of it, you can remove keys from it just as normal.
No. There is no convention when setting the URL schemes that says they have to be related at all to the bundle identifier. If you are looking for a specific one, or want to try and guess patterns on existing schemes, try here
The problem isn't really in how you call the animation, but in the drawing code you have for the views. If you optimize the logic and time required for rendering the views in those controllers, I guarantee you will see better performance in the animations between them.
You could try turning on the cache argument that you have currently set to NO to see if that helps in the short term, but it really is a bandaid, not a cure.
Also, with a frame rate of 60fps at best, a .5 second animation is going to have only 30 frames to work with at most. If you increase the animation duration a little, it will appear to be smoother once you have the view rendering optimized.
In rails 3.0.9 (and maybe earlier) this code no longer works:
//feed.atom.builder
atom_feed :language => 'en-US' do |feed|
feed.title @title
feed.updated @updated
feed.link('href' => 'http://[REDACTED].superfeedr.com/', 'rel' => "hub")
...
end
The exact error is: ArgumentError: wrong number of arguments (1 for 2) with a stack trace of:
/Users/[REDACTED]/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:302:in `ln'
[GEM_ROOT]@global/gems/rake-0.8.7/lib/rake.rb:1094:in `link'
[GEM_ROOT]/gems/actionpack-3.0.9/lib/action_view/helpers/atom_feed_helper.rb:146:in `method_missing'
app/views/feeds/index.atom.builder:4:in `block in _app_views_feeds_index_atom_builder___2426096422608134746_70129604713820_3077995114801777171'
[GEM_ROOT]/gems/actionpack-3.0.9/lib/action_view/helpers/atom_feed_helper.rb:123:in `block in atom_feed'
…
This is important for me and to setup a superfeedr Pubsubhubbub as described here. I need to get a <link rel="hub" … > tag into the atom feed but feed.link no longer works like it used to due to the method being removed from atom_feed_helper.rb. How can I get this link tag to show up again?
You don't need another gem for this. FactoryGirl has built in dynamic helpers for this. I suggest watching the short Railscast about this. Here is a snippet of how it works:
FactoryGirl.define do
factory :user do
sequence(:username) { |n| "foo#{n}" }
password "foobar"
email { "#{username}@example.com" }
I am building a 2-Legged OAuth provider for my api. Everything is hooked up properly and I can make signed calls from the rails console. The problem I have is that I am having trouble integrating OAuth into the controller_spec.
Here is an example of a working call on my server:
coneybeare $ rails c test
Loading test environment (Rails 3.2.0)
rails test: main
>> consumer = OAuth::Consumer.new("one_key", "MyString", :site => [REDACTED])
# => #<OAuth::Consumer:0x007f9d01252268 @key="one_key", @secret="MyString", @options={:signature_method=>"HMAC-SHA1", :request_token_path=>"/oauth/request_token", :authorize_path=>"/oauth/authorize", :access_token_path=>"/oauth/access_token", :proxy=>nil, :scheme=>:header, :http_method=>:post, :oauth_version=>"1.0", :site=>[REDACTED]}>
ruby: main
>> req = consumer.create_signed_request(:get, "/api/v1/client_applications.json", nil)
# => #<Net::HTTP::Get GET>
ruby: main
>> res = Net::HTTP.start([REDACTED]) {|http| http.request(req) }
# => #<Net::HTTPOK 200 OK readbody=true>
ruby: main
>> puts res.body
{"client_applications":[{"id":119059960,"name":"FooBar1","url":"http://test1.com"},{"id":504489040,"name":"FooBar2","url":"http://test2.com"}]}
# => nil
And here is what I am doing in my controller tests:
require 'oauth/client/action_controller_request'
describe Api::ClientApplicationsController do
include OAuthControllerSpecHelper
…
…
it "assigns all client_applications as @client_applications" do
consumer = OAuth::Consumer.new("one_key", "MyString", :site => [REDACTED])
ActionController::TestRequest.use_oauth=true
@request.configure_oauth(consumer)
@request.apply_oauth!
puts "request.env['Authorization'] = #{@request.env['Authorization']}"
get :index, {:api_version => 'v1', :format => :json}
response.should be_success # Just this for now until I can get authorization, then proper controller testing
end
end
The output of that test:
request.env['Authorization'] = OAuth oauth_consumer_key="one_key", oauth_nonce="gzAbvBSWyFtIYKfuokMAdu6VnH39EHeXvebbH2qUtE", oauth_signature="juBkJo5K0WLu9mYqHVC3Ar%2FATUs%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1328474800", oauth_version="1.0"
1) Api::ClientApplicationsController GET index assigns all client_applications as @client_applications
Failure/Error: response.should be_success
expected success? to return true, got false
And the corresponding server call from the rails log:
Processing by Api::ClientApplicationsController#index as JSON
Parameters: {"api_version"=>1}
Rendered text template (0.0ms)
Filter chain halted as #<OAuth::Controllers::ApplicationControllerMethods::Filter:0x007f85a51a8858 @options={:interactive=>false, :strategies=>:two_legged}, @strategies=[:two_legged]> rendered or redirected
Completed 401 Unauthorized in 15ms (Views: 14.1ms | ActiveRecord: 0.0ms)
(0.2ms) ROLLBACK
I just can't figure out why it's not working :/ Am I making an obvious mistake?
Turns out that the best way to test my controller was the simplest as well. Instead of trying to sign each test so the controller gets the right information (something that indeed does belong in a request spec not a controller spec), I figured out that I could just give the controller the information it needed manually.
To do this, I simply had to stub 2 methods:
fixtures :client_applications
before(:each) do
@client_application1 = client_applications(:client_application1)
Api::ClientApplicationsController::Authenticator.any_instance.stub(:allow?).and_return(true)
controller.stub(:client_application).and_return(@client_application1)
end
Stubbing the allow? method caused the rack auth to be fooled into thinking it was authenticated. allow? also set the client_application based on the credentials though, so I had to stub that as well. Now that the auth is out of the way, I can test my controller properly.
I am starting an activity and would rather have a alpha fade-in for startActivity(), and a fade-out for the finish(). How can I go about this in the Android SDK?
I just wrote a blog post on this: How to Convert Simple Rails 2.3 Style Plugins for Rails 3.2
FYI, as of May 2012, Apple has began to reject apps that use the Dropbox API.
REAL_IMAGE_SOURCE is the address of the image source. "server.com/image.png" or whatever.
Turns out the problem was with the Cufon js running through any of the JS compressors. Once I switched to Google Web Fonts, then compressed all the remaining files, it worked just fine.
Turns out the problem was with the Cufon js running through any of the JS compressors. Once I switched to Google Web Fonts, then compressed all the remaining files, it worked just fine.
Not sure if thats the problem. The page has a single JS file, and other JS works as expected. This means that the JS is having an interpretation problem midway through the file. I find that my Cufon stuff is not working correctly... I will try looking there
@Rob, could you explain a bit more? looking at cloudfront.giantuser.com/assets/…, It appears to be only gzipped once
*ungzipped That last sentence was confusing
The compressed, combined JS is hosted on amazon and is uncompressed. Checkout the example file I posted in the OP
Why would the illegal character be different on each engine...
Thanks for helping me localize the problem. Here is a follow-up question if you are interested: stackoverflow.com/questions/10354420/…
i'll check it out... looks like it may be caused by my JS compressor, but I can't seem to find the character.
Yup. <comment padding>
No, max length includes that many characters, If i have a max length of 10, i should get 10 characters. Evan's comment would mean only 9
it also doesn't work with pink elephants... what is your point?