public
Fork of timcharper/git-tmbundle
Description: The official github mirror for the Git TextMate Bundle
Homepage: http://tim.theenchanter.com/
Clone URL: git://github.com/subtleGradient/git-tmbundle.git
Search Repo:
Added a "Git Config" command - currently supports Email and Name
timcharper (author)
Fri Apr 04 21:53:41 -0700 2008
commit  d28efbe0f9377892d6d7df78e4e0fe3efd599f0a
tree    00cdf0262240e1e59f20b8b6fea1077f941d9744
parent  88ed4ae73cbd930f66ce5dd8a1bfc2f632ef2726
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
0
@@ -1 +1,22 @@
0
+<?xml version="1.0" encoding="UTF-8"?>
0
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
0
+<plist version="1.0">
0
+<dict>
0
+ <key>beforeRunningCommand</key>
0
+ <string>nop</string>
0
+ <key>command</key>
0
+ <string>#!/usr/bin/env ruby
0
+
0
+require ENV['TM_BUNDLE_SUPPORT'] + '/environment.rb'
0
+dispatch :controller =&gt; "config", :action =&gt; "index"</string>
0
+ <key>input</key>
0
+ <string>none</string>
0
+ <key>name</key>
0
+ <string>Config…</string>
0
+ <key>output</key>
0
+ <string>showAsHTML</string>
0
+ <key>uuid</key>
0
+ <string>794C7EF9-B0A5-4B27-90BD-000837237B85</string>
0
+</dict>
0
+</plist>
...
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
0
@@ -1 +1,12 @@
0
+class ConfigController < ApplicationController
0
+ include ConfigHelper
0
+ def index
0
+ render "index"
0
+ end
0
+
0
+ def set
0
+ value = params[:value]
0
+ git.config[(params[:scope] || "local"), params[:key]] = params[:value]
0
+ end
0
+end
...
 
 
 
 
...
1
2
3
4
0
@@ -1 +1,5 @@
0
+module ConfigHelper
0
+ def config_line
0
+ end
0
+end
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
0
@@ -1 +1,20 @@
0
+<h1>Config</h1>
0
+<form>
0
+ <table>
0
+ <thead>
0
+ <tr>
0
+ <th>Global Config</th>
0
+<!-- <th>Local Config Config</th>-->
0
+ </tr>
0
+ </thead>
0
+ <tbody>
0
+ <tr>
0
+ <td>
0
+ Name: <%= content_tag :input, :type => "text", :value => git.config[:global, "user.name"], :onchange => "dispatch({controller: 'config', action: 'set', scope: 'global', key: 'user.name', value: $F(this)})" %><br/>
0
+ Email: <%= content_tag :input, :type => "text", :value => git.config[:global, "user.email"], :onchange => "dispatch({controller: 'config', action: 'set', scope: 'global', key: 'user.email', value: $F(this)})" %><br/>
0
+ </td>
0
+ </tr>
0
+ </tbody>
0
+ </table>
0
+</form>
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
0
@@ -1 +1,25 @@
0
+require File.dirname(__FILE__) + '/../spec_helper'
0
+
0
+describe ConfigController do
0
+ include SpecHelpers
0
+ include Parsers
0
+
0
+ before(:each) do
0
+ @controller = ConfigController.singleton_new
0
+ @git = Git.singleton_new
0
+ end
0
+
0
+ describe "when setting values" do
0
+ it "should default to local" do
0
+ @git.config.should_receive(:[]=).with("local", "user.name", "My Name")
0
+ capture_output { dispatch(:controller => "config", :action => "set", :key => "user.name", :value => "My Name" )}
0
+ end
0
+
0
+ it "should allow setting of global variables" do
0
+ @git.config.should_receive(:[]=).with("global", "user.name", "My Name")
0
+ capture_output { dispatch(:controller => "config", :action => "set", :scope => "global", :key => "user.name", :value => "My Name" )}
0
+ end
0
+ end
0
+
0
+end
...
109
110
111
 
 
112
113
114
...
109
110
111
112
113
114
115
116
0
@@ -109,6 +109,8 @@
0
     <string>CFB9BB9D-4F47-47DA-819B-58F0B29FA560</string>
0
     <string>1CCC4394-A243-4E78-A720-B2DA1BC37DC0</string>
0
     <string>556EF65D-C59B-4A15-BA4A-D5D87C2695A0</string>
0
+ <string>3F77F0FC-F476-4B83-92D1-77D854A9D64D</string>
0
+ <string>794C7EF9-B0A5-4B27-90BD-000837237B85</string>
0
   </array>
0
   <key>uuid</key>
0
   <string>EADD4718-EE11-4ABF-A7E6-13351FB3799D</string>

Comments

    No one has commented yet.